I'm making a money giver that turns off and on to do this I'm using a simple can collide off and on but for some reason with this script in it. it will not give you the money here are the scripts.
while true do
wait(450)
script.Parent.CanCollide = true
script.Parent:Remove()
wait(200)
script.Parent.CanCollide = false
script.Parent:Remove()
end
deb = false
script.Parent.Touched:connect(function(part)
if game.Players:FindFirstChild(part.Parent.Name) then
if deb == false then
deb = true
local plr = game.ServerStorage.PlayerMoney:FindFirstChild(part.Parent.Name)
script.Parent.BrickColor = BrickColor.new("Bright red")
plr.Value = plr.Value + script.Parent.Parent.Amount.Value
wait(script.Parent.Parent.TimeToWait.Value)
deb = false
script.Parent.BrickColor = BrickColor.new("Bright green")
end
end
end)

1 comment
Simple fix.
:Remove()is deprecated and no longer works. To delete, you now use:Destroy()