Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 📜Coin Script📜
- WaitTime = 5 -- How many seconds to respawn the coin!
- Amount = 1 -- Amount of coins per coin!
- function onTouched(part)
- local h = part.Parent:findFirstChild("Humanoid")
- if (h~=nil) then
- local thisplr = game.Players:FindFirstChild(h.Parent.Name)
- if (thisplr~=nil) then
- local stats = thisplr:findFirstChild("leaderstats")
- if (stats~=nil) then
- local Score = stats:findFirstChild("Coins")
- if (Score~=nil) then
- Score.Value = Score.Value + Amount
- end
- end
- end
- script.Parent.Transparency = 1
- script.Disabled = true
- wait(WaitTime)
- script.Parent.Transparency = 0
- script.Disabled = false
- end
- end
- script.Parent.Touched:Connect(onTouched)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement