https://i.gyazo.com/d5ecd8aa50f846c9cff40b9aecf21ba6.gif
My script how it currently is:
-- "Fade" is the brick that triggers the transparency when stepped on. -- "Robloxian" is the model. local invis = true game.Workspace.Fade.Touched:Connect(function(hit) if not invis then return end if not hit.Parent:FindFirstChild("Humanoid") then return end invis = false for k2,v2 in pairs(game.Workspace.Robloxian:GetDescendants()) do if v2:IsA("BasePart") then v2.Transparency = 0.2 wait() v2.Transparency = 0.4 wait() v2.Transparency = 0.6 wait() v2.Transparency = 0.8 wait() v2.Transparency = 1 end end end)
How do you make the decals transparent as well? I've always had issues with decals and transparency.
i edited cmgtotalyawesome's script a bit, it should be working
local invis = true local parts = {} workspace.Fade.Touched:Connect(function(hit) if not invis then return end if not hit.Parent:FindFirstChild("Humanoid") then return end invis = false for k2,v2 in pairs(game.Workspace.Robloxian:GetDescendants()) do if v2:IsA("BasePart") or v2:IsA("Decal") and v2.Transparency ~= 1 then table.insert(parts, v2) end end for i = 1, 5 do wait(0.2) for x = 1, #parts do parts[x].Transparency = 0.2 * i end end end)
What I would do to accomplish this is add every basepart and decal to a table and then run a loop like so:
-- "Fade" is the brick that triggers the transparency when stepped on. -- "Robloxian" is the model. local invis = true local parts = {} game.Workspace.Fade.Touched:Connect(function(hit) if not invis then return end if not hit.Parent:FindFirstChild("Humanoid") then return end invis = false for k2,v2 in pairs(game.Workspace.Robloxian:GetDescendants()) do if v2:IsA("BasePart") or v2:IsA("Decal") then table.insert(parts, #parts + 1) end end for i = 1, 5 do wait(--[[however long you wanna wait]]) for x = 1, #parts do parts[x].Transparency = .2 * i end end end)
I'm not sure if this will work as I don't really have access to studio right now, however if it does error leave the error as a comment and I'll fix it as soon as I can.
-- "Fade" is the brick that triggers the transparency when stepped on. -- "Robloxian" is the model. local invis = true local parts = {} game.Workspace.Fade.Touched:Connect(function(hit) if not invis then return end if not hit.Parent:FindFirstChild("Humanoid") then return end invis = false for k2,v2 in pairs(game.Workspace.Robloxian:GetDescendants()) do if v2:IsA("BasePart") or v2:IsA("Decal") then table.insert(parts, #parts + 1) end end for i = 1, 5 do for x = 1, #parts do parts[x].Transparency -= 0.1 wait(0.3) parts[x].Transparency -= 0.1 wait(0.3) parts[x].Transparency -= 0.1 wait(0.3) parts[x].Transparency -= 0.1 wait(0.3) parts[x].Transparency -= 0.1 wait(0.3) parts[x].Transparency -= 0.1 wait(0.3) parts[x].Transparency -= 0.1 wait(0.3) parts[x].Transparency -= 0.1 wait(0.3) parts[x].Transparency -= 0.1 wait(0.3) parts[x].Transparency -= 0.1 end end end)
I am not sure if this will work but you can try