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

Why Doesn't This Script Execute??

Asked by
8391ice 91
8 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

The script below is supposed to create a message saying "(player) has entered the server". But when I test it in the Studio, it doesn't work! Why might this be?

game.Players.PlayerAdded:connect(function(player)
    print("Player Entered")
    script.Parent.Text = player.Name.. " has entered the server"
    wait(5)
    script.Parent.Text = ""
end)
0
Is this a localScript? theCJarmy7 1293 — 8y
0
I've tried it with a localScript and it didn't work either. 8391ice 91 — 8y
0
Where is the script? theCJarmy7 1293 — 8y
0
In a TextLabel in a StarterGUI. 8391ice 91 — 8y
0
It has to be a serverScript, and use game.Players.LocalPlayer in localScripts theCJarmy7 1293 — 8y

1 answer

Log in to vote
-1
Answered by 8 years ago

That's because in studio, it won't recognize a new player being added through playeradded, just publish it and test it by playing the game. The script executes, in a normal game but not in studio.

1
What? User#11440 120 — 8y
1
I tried testing it in a normal game, yet it still didn't work... 8391ice 91 — 8y
Ad

Answer this question