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

How do i make a part disappear and become untouchable for 5 seconds?

Asked by 8 years ago

I am making a Spleef-like game, and I am having difficulties with the pieces i need to disappear. Specifically, i have been trying to make a brick go invisible and untouchable, effectively making it disappear, for 5 seconds, then reappear. But once a player touches it, he needs just enough time to run away, so he does not instantly fall. Help?

2 answers

Log in to vote
1
Answered by
iSvenDerp 233 Moderation Voter
8 years ago

Hi...(I cant test this right now but it should work) you would need to use the transparency and cancollide property's. This isnt really a request site either but

part = script.Parent--this is making a variable part is the scripts parent so make sure the script is in the part.

function invisible()-- this is making a function so we can make this script.
    part.Transparency = 1 -- So we made the transparency invisible
    part.CanCollide = false-- and where u can walk through it
    wait(5)--were waiting 5 seconds then
    part.Transparency = 0 -- Its visible
    part.CanCollide = true --You cant walk through this
end --end
invisible() --we are calling our function

Like I said I cant test this right now but it should work. Hope this helped let me know if it did.

Ad
Log in to vote
0
Answered by 8 years ago

Place this script in the part, along with a ClickFunction:

function turnInvisible(part)
    part.Transparency = 0
    wait(1) --We have now waited 1 second
    part.Transparency = 0.2
    wait(1) --We have now waited 2 seconds
    part.Transparency = 0.4
    wait(1) --We have now waited 3 seconds
    part.Transparency = 0.6
    wait(1) --We have now waited 4 seconds
    part.Transparency = 0.8
    wait(1) --We have now waited 5 seconds
    part.Transparency = 1
    part.CanCollide = false
end
script.Parent.ClickDetector.MouseClick:connect(turnInvisible(script.Parent))

Answer this question