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 » Scripting Helpers
Home Search
 

Re: what's wrong with this?

Previous Thread :: Next Thread 
DualWindforks is not online. DualWindforks
Joined: 17 Oct 2013
Total Posts: 153
23 Jun 2014 09:19 PM
for i = 1,0,.1 do
local b = game.Workspace.Model:GetChildren("Part")
b.Transparency = i
wait()
end

no output.
assume all items are as shown.
Report Abuse
Geomaster is not online. Geomaster
Joined: 05 Jul 2008
Total Posts: 1480
23 Jun 2014 09:21 PM
You're trying to get to a lower number by a positive increment

for i = 1, 0, -.1 do
--blah--
wait()
end
Report Abuse
DualWindforks is not online. DualWindforks
Joined: 17 Oct 2013
Total Posts: 153
23 Jun 2014 09:23 PM
still no effect.
Report Abuse
Geomaster is not online. Geomaster
Joined: 05 Jul 2008
Total Posts: 1480
23 Jun 2014 09:25 PM
Uh, there's also the deal that :GetChildren doesn't return an instance, it returns a table
You could do this, however

local parts = workspace.Model:GetChildren()

for i = 1, 0, -.1 do
local b = parts["Part"]
b.Transparency = i
wait()
end
Report Abuse
DualWindforks is not online. DualWindforks
Joined: 17 Oct 2013
Total Posts: 153
23 Jun 2014 09:28 PM
21:27:20.686 - local parts = workspace.Model:GetChildren()

for i = 1, 0, :5: attempt to index local 'b' (a nil value)
21:27:20.687 - Stack Begin
21:27:20.687 - Script 'local parts = workspace.Model:GetChildren()

for i = 1, 0, ', Line 5
21:27:20.687 - Stack End
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
23 Jun 2014 09:29 PM
for i = 1,0,.1 do
for _, v in pairs(game.Workspace.Model:GetChildren()) do
if v:IsA"BasePart" then
v.Transparency = i
end
end
wait()
end
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
23 Jun 2014 09:31 PM
the function returns a table, and the argument is nil

to get all the parts, youd do

for tran=1,0,-0.1 do
children = Workspace.Model:GetChildren()
for I,v in pairs(children) do
if v:IsA("BasePart") or v.Name == "Part" then
ypcall(function() v.Transparency = tran
end
end
wait()
end
Report Abuse
DualWindforks is not online. DualWindforks
Joined: 17 Oct 2013
Total Posts: 153
23 Jun 2014 09:31 PM
got it, thanks
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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