Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local coin = script.Parent:: Part
- coin.Touched:Connect(function(hit)
- print("hit")
- local player = game.Players:GetPlayerFromCharacter(hit.Parent)
- if player then
- local coins = player:WaitForChild("leaderstats"):FindFirstChild("Coins"):: NumberValue
- coins.Value += 1
- coin:Destroy()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement