Advertisement
CODINGGIAN

Untitled

Mar 29th, 2025
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1.     --
  2.     script.Parent.Basic.Collector.Touched:Connect(function(object)
  3.         if object and object:FindFirstChild("Money") then
  4.             script.Vault.Value += object.Money.Value
  5.             object:Destroy()
  6.         end
  7.     end)
  8.    
  9.     -- if the Bank object gets touched connect with a function
  10.     script.Parent.Basic.Bank.Touched:Connect(function(object)
  11.         -- if the parent of the object that touched the model is character model
  12.         if object.Parent == player.Character then
  13.             -- increase the money on the server to value gathered in the Vault
  14.             moneyOnServer.Value += script.Vault.Value
  15.             -- change the value of gathered money in vault to 0
  16.             script.Vault.Value = 0
  17.         end
  18.     end)
  19.     --
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement