WolfGamesProgrammer

Receiver Boxes

Apr 15th, 2024
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.37 KB | Source Code | 0 0
  1. function OnTouched(hit)
  2.     local human = hit.Parent:FindFirstChild("Humanoid")
  3.     if human then
  4.         for index, value in pairs(hit.Parent:GetChildren()) do
  5.             if value.Name == "Box" then
  6.                 local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
  7.                 plr.leaderstats.Money.Value += 100
  8.                 value:Destroy()
  9.             end
  10.         end
  11.     end
  12. end
  13. script.Parent.Touched:Connect(OnTouched)
Advertisement
Add Comment
Please, Sign In to add comment