https://i.gyazo.com/d5ecd8aa50f846c9cff40b9aecf21ba6.gif
My script how it currently is:
01 | -- "Fade" is the brick that triggers the transparency when stepped on. |
02 | -- "Robloxian" is the model. |
03 | local invis = true |
04 |
05 | game.Workspace.Fade.Touched:Connect( function (hit) |
06 | if not invis then return end |
07 | if not hit.Parent:FindFirstChild( "Humanoid" ) then return end |
08 | invis = false |
09 | for k 2 ,v 2 in pairs (game.Workspace.Robloxian:GetDescendants()) do |
10 | if v 2 :IsA( "BasePart" ) then |
11 | v 2. Transparency = 0.2 |
12 | wait() |
13 | v 2. Transparency = 0.4 |
14 | wait() |
15 | v 2. Transparency = 0.6 |
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
01 | local invis = true |
02 | local parts = { } |
03 | workspace.Fade.Touched:Connect( function (hit) |
04 | if not invis then return end |
05 | if not hit.Parent:FindFirstChild( "Humanoid" ) then return end |
06 | invis = false |
07 | for k 2 ,v 2 in pairs (game.Workspace.Robloxian:GetDescendants()) do |
08 | if v 2 :IsA( "BasePart" ) or v 2 :IsA( "Decal" ) and v 2. Transparency ~ = 1 then |
09 | table.insert(parts, v 2 ) |
10 | end |
11 | end |
12 |
13 | for i = 1 , 5 do |
14 | wait( 0.2 ) |
15 | for x = 1 , #parts do |
16 | parts [ x ] .Transparency = 0.2 * i |
17 | end |
18 | end |
19 | end ) |
What I would do to accomplish this is add every basepart and decal to a table and then run a loop like so:
01 | -- "Fade" is the brick that triggers the transparency when stepped on. |
02 | -- "Robloxian" is the model. |
03 | local invis = true |
04 | local parts = { } |
05 |
06 | game.Workspace.Fade.Touched:Connect( function (hit) |
07 | if not invis then return end |
08 | if not hit.Parent:FindFirstChild( "Humanoid" ) then return end |
09 | invis = false |
10 | for k 2 ,v 2 in pairs (game.Workspace.Robloxian:GetDescendants()) do |
11 | if v 2 :IsA( "BasePart" ) or v 2 :IsA( "Decal" ) then |
12 | table.insert(parts, #parts + 1 ) |
13 | end |
14 | end |
15 |
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.
01 | -- "Fade" is the brick that triggers the transparency when stepped on. |
02 | -- "Robloxian" is the model. |
03 | local invis = true |
04 | local parts = { } |
05 |
06 | game.Workspace.Fade.Touched:Connect( function (hit) |
07 | if not invis then return end |
08 | if not hit.Parent:FindFirstChild( "Humanoid" ) then return end |
09 | invis = false |
10 | for k 2 ,v 2 in pairs (game.Workspace.Robloxian:GetDescendants()) do |
11 | if v 2 :IsA( "BasePart" ) or v 2 :IsA( "Decal" ) then |
12 | table.insert(parts, #parts + 1 ) |
13 | end |
14 | end |
15 |
I am not sure if this will work but you can try