Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can some on Help me to fix this disappearing brick script?

Asked by 10 years ago

this is what i have done but it is not working

step = game.Workspace.step function onTouched(hit) human = hit.Parent:FindFirstChild("Humanoid")

step.cancollide = false stem.transpararency = 1 wait (2) step.cancollide = true stem.transpararency = 0 end end

script.Parent.Touched:connect(onTouched)

2 answers

Log in to vote
1
Answered by 10 years ago
local step = Workspace:FindFirstChild("step")
if step then
script.Parent.Touched:connect(function(hit)
human = hit.Parent:FindFirstChild("Humanoid")
if human then
step.CanCollide = false
step.Transparency = 1
wait(3)
step.CanCollide = true
step.Transparency = 0
end
end)
else error('The step was not found!');
end

This should work.

0
yes it did thanks mrpoliceman2004 20 — 10y
Ad
Log in to vote
-1
Answered by
yurhomi10 192
10 years ago

sometimes adding a debounce is useful, also, make sure to always Capitalize the first letter when changing the Property or else it wont work.

touched = false

step.Touched:connect(function(hit)
human = hit.Parent:FindFirstChild("Humanoid")

if touched == false and h then 
touched = true
step.CanCollide = false
step.Transparency = 1
wait(2)
step.CanCollide = true
stem.Transparency = 0
touched = false
end
end)
0
nope none of those is working mrpoliceman2004 20 — 10y

Answer this question