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

what is wrong with this script?

game.Players.PlayerAdded:connect(function(player)



if player.Name==("Player1") then


KeyClone=game.ServerStorage.Key:Clone()


KeyClone.Parent=player.Backpack 



end

end)

2 answers

Not exactly sure. But you can find the answer by viewing the output while you're in test mode. The output tells you the area of the script that is incorrect and is an easy way to spot problems. Click the "View" button at the top and select its child "Output" to find what is wrong with your script.

I prefer spacing your ='s. KeyClone = game.ServerStorage.Key:Clone() should be at the top.

Then it should say...

game.Players.PlayerAdded:connect(function(player)

KeyClone = game.ServerStorage.Key:Clone()

if player.Name == ("Player1") then

KeyClone.Parent = player.Backpack

end
end)

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