I made a burger and when you touch it ONCE, it disappears and rewards you 50 points. After it respawns and you collect it, it doesn't reward any points after that. Is there any way to fix this?
Reward Script
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local Name = hit.Parent.Name
local Plr = game.Players:FindFirstChild(Name)
Plr.leaderstats.Points.Value = Plr.leaderstats.Points.Value + 50
end
end)
Timed Regen Script
local burger = script.Parent
local backup = burger:Clone()
burger.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild('Humanoid') then -- if the part that touched it has a humanoid then
burger:remove()
wait(5)
burger = backup
burger.Parent = game.Workspace
burger:makeJoints()
end
end)

2 comments
well, the event is only firing when the original burger is touched, not any of the clones
how would I make it so that the event will fire if you touch the clones?