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: Help with iterating trough arrays.

Previous Thread :: Next Thread 
ohno1112 is not online. ohno1112
Joined: 23 Mar 2013
Total Posts: 833
11 Jun 2014 10:00 AM
im trying to set some decals' textures, using the following:

decals = {workspace.Trains.NSSLT2601.Train.Wagon1.Prop.Bord.Decal, workspace.Trains.NSSLT2601.Train.Wagon1.Prop.Bord1.Decal, workspace.Trains.NSSLT2601.Train.Wagon3.Prop.Bord.Decal, workspace.Trains.NSSLT2601.Train.Wagon3.Prop.Bord1.Decal, workspace.Trains.NSSLT2601.Train.Wagon3.Prop.Bord2.Decal}
for i,v in pairs(decals)do
decals[i].Texture = "http://www.roblox.com/asset/?id=141078470"
end

for some reason, this doesnt work in a script, but it does work from command bar.

what's wrong?
Report Abuse
COOLDUDE11OO is not online. COOLDUDE11OO
Joined: 21 Aug 2011
Total Posts: 5115
11 Jun 2014 10:03 AM
for i,v in ipairs(decals)do
decals[i].Texture = "http://www.roblox.com/asset/?id=141078470"
end
Report Abuse
ohno1112 is not online. ohno1112
Joined: 23 Mar 2013
Total Posts: 833
11 Jun 2014 10:05 AM
changing pairs to ipairs did nothing..

also, here's the whole script, if it can help.


P = script.Parent.Parent
signs = {workspace.Trains.NSSLT2601.Train.Wagon1.Prop.Sign.SurfaceGui.mainframe, workspace.Trains.NSSLT2601.Train.Wagon1.Prop.Sign1.SurfaceGui.mainframe, workspace.Trains.NSSLT2601.Train.Wagonorkspace.Trains.NSSLT2601.Train.Wagon1.Prop.Bord2.Decal.Texture, workspace.Trains.NSSLT3.Prop.Sign.SurfaceGui.mainframe, workspace.Trains.NSSLT2601.Train.Wagon3.Prop.Sign1.SurfaceGui.mainframe}
signst = {workspace.Trains.NSSLT2601.Train.Wagon1.Prop.Sign.Transparency,
workspace.Trains.NSSLT2601.Train.Wagon1.Prop.Sign1.Transparency,
workspace.Trains.NSSLT2601.Train.Wagon3.Prop.Sign.Transparency,
workspace.Trains.NSSLT2601.Train.Wagon3.Prop.Sign1.Transparency}
function confirm()
if P.Depv.Value == "Utrecht" and P.Arvv.Value == "Amsterdam" and P.Serv.Value == "Sprinter" then
decals = {workspace.Trains.NSSLT2601.Train.Wagon1.Prop.Bord.Decal, workspace.Trains.NSSLT2601.Train.Wagon1.Prop.Bord1.Decal, workspace.Trains.NSSLT2601.Train.Wagon3.Prop.Bord.Decal, workspace.Trains.NSSLT2601.Train.Wagon3.Prop.Bord1.Decal, workspace.Trains.NSSLT2601.Train.Wagon3.Prop.Bord2.Decal}
for i,v in ipairs(decals)do
decals[i].Texture = "http://www.roblox.com/asset/?id=141078470"
end
script.Parent.Parent.Parent.Frame.Terminus.Text = "Terminus: Amsterdam Centraal"
Workspace.Trains.NSSLT2601.Train.Wagon1.Dest.Value = "sprAmsterdam"
script.Parent.Parent.Parent.Frame.nextstop.Text = "Next: Utrecht Zuilen"
end
end
script.Parent.MouseButton1Down:connect(confirm)
Report Abuse
ohno1112 is not online. ohno1112
Joined: 23 Mar 2013
Total Posts: 833
11 Jun 2014 10:07 AM
Running just

decals = {workspace.Trains.NSSLT2601.Train.Wagon1.Prop.Bord.Decal, workspace.Trains.NSSLT2601.Train.Wagon1.Prop.Bord1.Decal, workspace.Trains.NSSLT2601.Train.Wagon3.Prop.Bord.Decal, workspace.Trains.NSSLT2601.Train.Wagon3.Prop.Bord1.Decal, workspace.Trains.NSSLT2601.Train.Wagon3.Prop.Bord2.Decal}
for i,v in ipairs(decals)do
decals[i].Texture = "http://www.roblox.com/asset/?id=141078470"
end

Works, however in that script it doesnt..
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
11 Jun 2014 10:24 AM
v.Texture

Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
11 Jun 2014 10:28 AM
@Verified
Both are fine.


@OP
It seems like your asset link is incorrect. It looks as if you have an extras / after asset. Try this one:


decals[i].Texture = "http://www.roblox.com/asset?id=141078470"
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