Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --
- script.Parent.Basic.Collector.Touched:Connect(function(object)
- if object and object:FindFirstChild("Money") then
- script.Vault.Value += object.Money.Value
- object:Destroy()
- end
- end)
- -- if the Bank object gets touched connect with a function
- script.Parent.Basic.Bank.Touched:Connect(function(object)
- -- if the parent of the object that touched the model is character model
- if object.Parent == player.Character then
- -- increase the money on the server to value gathered in the Vault
- moneyOnServer.Value += script.Vault.Value
- -- change the value of gathered money in vault to 0
- script.Vault.Value = 0
- end
- end)
- --
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement