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

Script Doesn't execute when player enters?

local player = game.Players.LocalPlayer

BT = script.Parent.TextExamine

function onPlayerEntered(newPlayer) newPlayer:WaitForDataReady() BT.Text = player.GlobalCount.Value script.Parent.TotalPlayers.Text = "Total Players" player:WaitForChild("GlobalCount") if player.GlobalCount.Value == 0 then player.GlobalCount.Value = player.GlobalCount.Value + 1 elseif player.GlobalCount.Value == 1 then print(" plus one ") end end

game.Players.ChildAdded:Connect(onPlayerEntered)

What is wrong with this script because it doesn't seem to execute when a player joins.

3 comments

0

You know, that "newPlayer:WaitForDataReady()" is deprecated. http://wiki.roblox.com/index.php?title=API:Class/Player/LoadNumber

0

thanks didn't know

1 answer

game.Players.PlayerAdded:connect(function(newPlayer) -- PlayerAdded, **NOT** childadded
	-- code
end)

Click here to actually post a good forum on scriptinghelpers

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