#error "Expected identifier when parsing expression, got ')'

103 messages · Page 1 of 1 (latest)

tall fox
#

if game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(message)
if string.lower(message) == '/boderman' then
wait (5)
script.Parent.Visible = true
end)

#

idk how to fix this

#

when i type the command /boderman in the chat it will wait 5 seconds and show a text label. that is what im trying to do

somber kayak
#
if game.Players.PlayerAdded:Connect(function(player)
    player.Chatted:Connect(function(message)
            if string.lower(message) == '/boderman' then
                wait (5)
                script.Parent.Visible = true
            end
     end)
end)
tall fox
#

i will try

#

doesnt work

#

for some reason

#

ill read you errors

#

Players.LuniDoge.PlayerGui.bodergui.Frame.Script:8: Expected 'then' when parsing if statement, got <eof>

somber kayak
#

Oh... I see...

#
game.Players.PlayerAdded:Connect(function(player)
    player.Chatted:Connect(function(message)
            if string.lower(message) == '/boderman' then
                wait (5)
                script.Parent.Visible = true
            end
     end)
end)```
#

This should work

tall fox
#

yep

sage ploverBOT
#

studio** You are now Level 1! **studio

tall fox
#

works

#

thanks \

#

i appreciate it

#

uhh

#

it doesnt give any errors but it doesnt show the text

somber kayak
#

Use print and see where your script is not working

tall fox
#

sorry im new to scripting how do i do that

somber kayak
#
game.Players.PlayerAdded:Connect(function(player)
  print("Print")
  player.Chatted:Connect(function(message)
    print("Another Print?!")
      if string.lower(message) == '/boderman' then
        print("Wait what?! IS IT PRINTING?!")
        wait (5)
        script.Parent.Visible = true
      end
  end)
end)
tall fox
#

and i just paste that into the script right?

somber kayak
#

Replace with what you have

tall fox
#

ok

#

nothing

#

it didnt print anything

somber kayak
#

Where are you using this script and what type of script is it?

tall fox
#

screen gui in starter gui and its a script

#

screen gui > frame > textlabel and script

somber kayak
#

Hm... Dont think you can use "PlayerAdded" outside of "ServerScriptService"

#

Try getting player in other way

tall fox
#

idk

bold remnant
#

Where is the script ?

#

Is it a script ? Or a localscript ?

tall fox
#

script

bold remnant
#

Where is the script

somber kayak
#

So you know what happen to everything inside the build-in "folders" that start with Starter when a player join?

bold remnant
#

I don't think script can run in gui

somber kayak
tall fox
#

screen gui > frame > textlabel and script

bold remnant
#

A script can modify gui elements ?

somber kayak
tall fox
#

im sooo new to scripting so i dont have an idea

somber kayak
#

only for that player

bold remnant
#

If you put it in server script does it print ?

tall fox
#

i thought of doing that

sage ploverBOT
#

studio** You are now Level 2! **studio

tall fox
#

but idk if it will work

#

ill try

bold remnant
#

Just to see if it print

somber kayak
#

It should

#

At least the first print

#

Dark, do you know if ".Chatted" can be used in server script?

bold remnant
#

I can

tall fox
#

i put it in server script service

#

and nothing

somber kayak
#

I? hmm

bold remnant
#

It*

somber kayak
#

Ah

bold remnant
tall fox
#

???

bold remnant
#

Runcontext

tall fox
#

client or server

bold remnant
#

Server

somber kayak
#

Aight so here is how you should do it:
Create a server script inside : StarterGui > ScreenGui > Frame > TextLabel
Now open the script and get the player like this:

local plr = script.Parent.Parent.Parent.Parent.Parent.Paren

and now print(plr) to see if you got it

#

Tell us what it prints

tall fox
#

i tried what dark told me to do

#

gui is in server script service

#

it printed

somber kayak
#

And did anything you wanted happened?

tall fox
#

no

somber kayak
#

Is the script inside "ServerScriptService"?

tall fox
#

its inside the gui and the gui is inside serverscript

bold remnant
#

Put the gui inside staftergui

tall fox
#

a

somber kayak
bold remnant
#

I think script cannot run in staftergui etc

tall fox
#

now its not printing

bold remnant
#

Now use a local script

tall fox
#

alright

somber kayak
tall fox
#

i want it so that when i type the command /boderman in chat it will wait 5 seconds and show a text label, then hide it after 5 seconds

somber kayak
#

Pretty easy to do, lemme open Roblox Studio

tall fox
#

because i wanna make a remake of a blackout from a different roblox game

#

and there was a voice and subtitle

#

so ye

#

i wanna do the subtitle text

somber kayak
#

Ok so:
A Server Script CAN RUN inside the StarterGui
To use ".Chatted" you need a local script (nvm it can run on server too)

tall fox
#

if you can make me a short tutorial one what to do so i dont mess it up for the 10th time

somber kayak
#
local plr = script.Parent.Parent.Parent.Parent.Parent

local TextLabel = script.Parent
TextLabel.Visible = false

local chatted = false

plr.Chatted:Connect(function(message)
    if chatted == false then
        chatted = true
        if string.lower(message) == "/yes" then
            TextLabel.Visible = true
            task.wait(5)
            TextLabel.Visible = false
        end
        chatted = false
    end
end)
#

This should 100% work

tall fox
#

okay

somber kayak
#

Get the code again, I changed a thing there to not be able to just spam the chat with the "command"

tall fox
#

ill see

#

YES

#

IT WORK

#

S

#

VERY NICE

somber kayak
#

Awesome