Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local players = game:GetService("Players")
- local multiplier = 2 -- replace this if you want. if you replace it to 2 for example, you will get 2 coins per 1 bag space
- script.Parent.Touched:Connect(function(c) -- c is the character
- if c.Parent:FindFirstChild("Humanoid") then
- local p = players:GetPlayerFromCharacter(c.Parent)
- local coins = p:WaitForChild("leaderstats"):WaitForChild("Coins")
- local bag = p:WaitForChild("leaderstats"):WaitForChild("Bag")
- coins.Value += bag.Value * multiplier
- bag.Value = 0
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement