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

Script Doesn't execute when player enters?

Asked by 6 years ago

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.

1 answer

Log in to vote
0
Answered by 6 years ago
game.Players.PlayerAdded:connect(function(newPlayer) -- PlayerAdded, **NOT** childadded
    -- code
end)

Click here to actually post a good forum on scriptinghelpers

Ad

Answer this question