I want to make a trip brick that makes player fall but I only want it to work once for every player. More specific,I am making a zombie virus by heavily modifying a zarm. Now I want to make it so that when someone gets infected he falls to the ground for a few seconds but only once in his lifetime because when I test it zombies trip other zombies and it looks stupid so I want to make it only work once on every player and when the player resets or dies,he can then be tripped again. On my attempt to make it work I tried sticking some zarm lines into the code but failed,I know that "if cantouch = 0/1 then" lines do what I want but I can't seem to figure out how to do the same with this code,sorry but first few lines are in this part of the text and I did not know how to fix that:
b = script.Parent
b.Touched:connect(function(hit)
local c = hit.Parent
if c then
for _,h in next, c:GetChildren() do
if h:IsA'Humanoid' and h.Health > 0 and h:GetState().Name ~= 'Physics' then
local newscript = script.physics:Clone()
newscript.Parent = c
newscript.Disabled = false
wait(10)
if h.Parent then
local newscript = script.gettingup:Clone()
newscript.Parent = c
newscript.Disabled = false
end
break
end
end
end
end)

1 comment
Use the code block properly