I'm trying to make it so when a player joins the game, it clones a IntValue from the Lighting to the Player. This is the script I'm using below but it only works once on one player and fails to work on the next, what is wrong with it? Thanks.
function onPlayerEntered(newPlayer) local iv = game.Lighting.playerstats iv.Parent = newPlayer iv.Clone() end game.Players.PlayerAdded:connect(onPlayerEntered)
Your problem is that you aren't cloning the int value when you are putting it into the player
function onPlayerEntered(newPlayer) local iv = game.Lighting.playerstats:Clone() --You also have to use ":" when cloning iv.Parent = newPlayer end game.Players.PlayerAdded:connect(onPlayerEntered)
This would clone the value and set the variable 'iv' as the cloned int val and then parent it to 'newPlayer'