Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

What is the problem with this?

Asked by 10 years ago

What's the problem with this script?

01function script(player)
02if Game.Players.PlayerAdded.Name == "Player1" then -- Player1 is for testing
03s = Instance.new ("Message")
04s.Parent = Game.Workspace
05s.Text = "The owner has joined!"
06 
07 
08 
09end
10end

2 answers

Log in to vote
1
Answered by 10 years ago

This should work

01game.Players.PlayerAdded:connect(function(player)
02    if player.Name == "Player1" then
03        s = Instance.new("Message")
04        s.Name = "asd"
05        s.Parent = Game.Workspace
06        s.Text = "The owner has joined"
07        wait (3)
08        game.Workspace.asd:Destroy()
09 
10    end
11end)

i added

1wait (3)
2game.Workspace.asd:Destroy()

or else the message will stay there forever

Ad
Log in to vote
-2
Answered by
Mystdar 352 Moderation Voter
10 years ago

I'm not too sure, but aren't

1function
2if
3then

all functions, so wouldn't you need 3 ends instead of two? Sorry if this doesn't help, new to scripting, trying to help.

1end
2end
3end
1
Myst, then goes with if groovydino 2 — 10y
0
Oh sorry, then, apologies Mystdar 352 — 10y

Answer this question