I have it so that when you touch a part, it finds a value within the character and adds a preset amount that's found inside another value in the part.
debounce = false
script.Parent.Touched:connect(function(hit)
if debounce == false
then
debounce = true
if hit.Parent:FindFirstChild("Humanoid") then
if hit.Parent:FindFirstChild("money") then
local money = hit.Parent:WaitForChild("money")
local amount = script.Parent:WaitForChild("howmuchmoney").Value
money.Value = money.Value + amount
wait(.5)
debounce = false
end
end
end
end)

1 comment
Is this running in a server script and are there any errors in console?