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

what is wrong with this script?

Asked by 10 years ago
game.Players.PlayerAdded:connect(function(player)



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


KeyClone=game.ServerStorage.Key:Clone()


KeyClone.Parent=player.Backpack 



end

end)

2 answers

Log in to vote
2
Answered by 10 years ago

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.

Ad
Log in to vote
0
Answered by
Reverge -1
10 years ago

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)

Answer this question