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

Error with Function?

Asked by 8 years ago

the goal is to create a function that whenever a player joins the value will increase by 1.

function playerEntered(Player)
game.workspace.PlrMax.value = game.workspace.PlrMax.value +1
end
game.Players.ChildAdded:connect(playerEntered)


1 answer

Log in to vote
0
Answered by 8 years ago

You had used ChildAdded instead of PlayerAdded and forgot to capitalize Value.

function playerEntered(Player)
game.workspace.PlrMax.Value = game.workspace.PlrMax.Value + 1
end
game.Players.PlayerAdded:connect(playerEntered)

Comment on this if it did not work

Ad

Answer this question