Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why Doesn't This Script Execute??

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)

5 comments

0

Is this a localScript?

0

I've tried it with a localScript and it didn't work either.

0

Where is the script?

0

In a TextLabel in a StarterGUI.

0

It has to be a serverScript, and use game.Players.LocalPlayer in localScripts

1 answer

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.

2 comments

1

What?

1

I tried testing it in a normal game, yet it still didn't work...

This discussion is preserved as it was. New answers, comments, and votes are closed.