Im trying to make the part vanish and have NoCollide and then reappear with CanCollide
function bananaz () h = 0 repeat game.workspace.part.transparency = (h) + 0.2 wait (1) until game.workspace.part.transparency == 1 repeat game.workspace.part.transparency = (h) - 0.2 wait (1) until game.workspace.part.transparency == 0 game.workspace.part.cancollide = false game.Workspace.Part.Touched:connect(bananaz)
Any help?
local t = 1 -- How much time the transition takes local intervals = 50 -- How smooth the transition is local busy = false script.Parent.Touched:connect(function() if not busy then busy = true for i = 0, 1, 1/intervals do script.Parent.Transparency = i wait(t/intervals) end script.Parent.CanCollide = false for i = 1, 0, -1/intervals do script.Parent.Transparency = i wait(t/intervals) end script.Parent.CanCollide = true busy = false end end)
This works, tested it myself.
EDIT: Replaced "workspace.part" with "script.Parent". If you put the script in the brick it should work.
function bananaz () h = 0 repeat game.workspace.part.transparency = (h) + 0.2 wait (1) game.workspace.part.cancollide = false until game.workspace.part.transparency == 1 repeat game.workspace.part.transparency = (h) - 0.2 wait (1) until game.workspace.part.transparency == 0 game.workspace.part.cancollide = true game.Workspace.Part.Touched:connect(bananaz)
maybe this will work
Im not sure if this is right but you could try and do
function bananaz() game.workspace.part.Transparency = 0 for i = 1,50 do game.workspace.part.Transparency = game.workspace.part.Transparency + 0.2 game.workspace.part.CanCollide = false wait(1) end for i = 1,50 do game.workspace.part.Transparency = game.workspace.part.Transparency - 0.2 game.workspace.part.CanCollide = true end game.Workspace.part.Touched:connect(bananaz)
I Think that should work :P