so i want to make an obstacle where a player has to travel across two parts but in between i want a killbrick that goes of repeatedly after waiting a certain amount of time
this is the script i have rn but im not sure what to do anymore
block = script.Parent
while wait(10) do
block.BrickColor = BrickColor.new(105,14,0)
function onTouched(Obj)
local h = Obj.Parent:FindFirstChild("Humanoid")
if h then
h.Health = 0
block.BrickColor = BrickColor.new(0,0,0)
end
end
script.Parent.Touched:Connect(onTouched)
end
can someone help please?

1 comment
not exactly, the script waits until someone touches it but i want it to go off randomly rather than wait till someone touches it for it to loop