generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: How to edit this script so it effects all parts in a model?

Previous Thread :: Next Thread 
Ternous is online. 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 is online. 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 is online. 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
ExecutionMode is not online. ExecutionMode
Joined: 12 Jan 2015
Total Posts: 380
14 Oct 2017 08:55 AM
use GetDescendants instead of recursion
Report Abuse
mattscy is online. 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
ExecutionMode is not online. ExecutionMode
Joined: 12 Jan 2015
Total Posts: 380
14 Oct 2017 08:59 AM
it's new
Report Abuse
mattscy is online. mattscy
Joined: 06 May 2011
Total Posts: 1079
14 Oct 2017 09:00 AM
oh that explains it thanks roblox
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image