Hello, I need some help.
I would like to script events for my camping game.
So I’d like to know how I could make invisible walls disappear after a certain amount of time. Can someone provide me a script that can help me do so, thank you!
1 Like
Put inside the part you want to disappear as a script
math.randomseed(tick())
while true do
local random = math.random(1,10)
wait(2)
for i = 1,10 do
wait(.1)
script.Parent.Transparency = script.Parent.Transparency + 0.1
end
script.Parent.CanCollide = false
wait(random)
for i = 1,10 do
wait(.1)
script.Parent.Transparency = script.Parent.Transparency - 0.1
end
script.Parent.CanCollide = true
end
Ok! I’ll try this. I will let you know if it works.
If you want the part to disappear forever after a certain amount of time put this:
math.randomseed(tick())
while true do
local random = math.random(1,10)
wait(2)
for i = 1,10 do
wait(.1)
script.Parent.Transparency = script.Parent.Transparency + 0.1
end
script.Parent.CanCollide = false
1 Like
It worked! Ill consider trying the second one too.
I also found a super simple script.
wait (10)
script.Parent.CanCollide = false
Would that script not be efficient?
Not really, all it does is disable CanCollide on that part, it doesn’t make the part disappear. It’s not efficient.
Ok, your scipt works well so ill use that, thanks.
1 Like