Advertisement
Guest User

Untitled

a guest
Aug 16th, 2022
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. local players = game:GetService("Players")
  2. 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
  3. script.Parent.Touched:Connect(function(c) -- c is the character
  4. if c.Parent:FindFirstChild("Humanoid") then
  5. local p = players:GetPlayerFromCharacter(c.Parent)
  6. local coins = p:WaitForChild("leaderstats"):WaitForChild("Coins")
  7. local bag = p:WaitForChild("leaderstats"):WaitForChild("Bag")
  8.  
  9. coins.Value += bag.Value * multiplier
  10. bag.Value = 0
  11. end
  12. end)
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement