Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer
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.

1 comment

0

yes it did thanks

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)

1 comment

0

nope none of those is working

This discussion is preserved as it was. New answers, comments, and votes are closed.