Ternous
|
  |
| Joined: 22 Oct 2012 |
| Total Posts: 1748 |
|
|
| 14 Oct 2017 06:49 AM |
right now I have to put this script in each part and they disappear at diffrent times, how do I make this so its only 1 script and it effects everything that is in a model.
part = sc############# while true do part.Transparency = 0 -- Hi ghost :P wait(0.1) part.Transparency = 0.1 wait(0.1) part.Transparency = 0.2 wait(0.1) part.Transparency = 0.3 wait(0.1) part.Transparency = 0.4 wait(0.1) part.Transparency = 0.5 wait(0.1) part.Transparency = 0.6 wait(0.1) part.Transparency = 0.7 wait(0.1) part.Transparency = 0.8 wait(0.1) part.Transparency = 0.9 wait(0.1) part.Transparency = 1 wait(math.random(5,10)) part.Transparency = 0.9 wait(0.1) part.Transparency = 0.8 wait(0.1) part.Transparency = 0.7 wait(0.1) part.Transparency = 0.6 wait(0.1) part.Transparency = 0.5 wait(0.1) part.Transparency = 0.4 wait(0.1) part.Transparency = 0.3 wait(0.1) part.Transparency = 0.2 wait(0.1) part.Transparency = 0.1 wait(0.1) part.Transparency = 0 wait(math.random(5,10)) end |
|
|
| Report Abuse |
|
|
Ternous
|
  |
| Joined: 22 Oct 2012 |
| Total Posts: 1748 |
|
|
| 14 Oct 2017 06:51 AM |
| Im pretty sure I have to change part = script.parent, but what too? |
|
|
| Report Abuse |
|
|
mattscy
|
  |
| Joined: 06 May 2011 |
| Total Posts: 1079 |
|
|
| 14 Oct 2017 08:53 AM |
put the script inside the model
local sp = script.Parent
function changeTransparency(inst,trans) if inst:IsA("BasePart") then inst.Transparency = inst.Transparency + trans end for _,v in pairs(inst:GetChildren()) do changeTransparency(v,trans) end end
while true do for i = 1,10 do changeTransparency(sp,0.1) end wait(math.random(5,10)) for i = 1,10 do changeTransparency(sp,-0.1) end wait(math.random(5,10)) end |
|
|
| Report Abuse |
|
|
|
| 14 Oct 2017 08:55 AM |
| use GetDescendants instead of recursion |
|
|
| Report Abuse |
|
|
mattscy
|
  |
| Joined: 06 May 2011 |
| Total Posts: 1079 |
|
|
| 14 Oct 2017 08:57 AM |
| why have i never heard of this whats wrong with me |
|
|
| Report Abuse |
|
|
| |
|
mattscy
|
  |
| Joined: 06 May 2011 |
| Total Posts: 1079 |
|
|
| 14 Oct 2017 09:00 AM |
| oh that explains it thanks roblox |
|
|
| Report Abuse |
|
|