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
 

String script not working

Previous Thread :: Next Thread 
vampirexevipex is not online. vampirexevipex
Joined: 11 Apr 2009
Total Posts: 1598
27 May 2013 06:03 PM
I dont understand why this doesn't work. It supposes to make a String Value starting with { having all of the script.Parent's children's properties and ending with }

but it just prints } and the string values ends being {{{... any ideas?

sp=script.Parent
m=""
derp=true
while derp do
c1=sp:GetChildren()
for i = 1,#c1 do
c=c1[i]
if c~=script then
m=m,"{",c.BrickColor,c.Anchored,c.Size,c.Position,c.CanCollide,"}"
print(m)
end
end
s=Instance.new("StringValue")
s.Parent=sp
s.Value=tostring(m)
derp=false
wait(1)
end
Report Abuse
nairod7 is not online. nairod7
Joined: 26 Mar 2010
Total Posts: 869
27 May 2013 06:08 PM
string concatenation: ..

local variable1 = "hello"
local variable2 = "world!"
print( variable1..", "..variable2 )

> hello, world!


Also, BrickColor, Anchored, etc... are userdata values and not string values. Use the function tostring.

m = m.."{"..tostring(c.BrickColor)..", "..tostring(c.Anchored)..", "..tostring(c.Size)..", "..tostring(c.Position)..", "..tostring(c.CanCollide).."}"

Something like this.
Report Abuse
vampirexevipex is not online. vampirexevipex
Joined: 11 Apr 2009
Total Posts: 1598
27 May 2013 06:14 PM
userdata values or not, it does work i tried it in the command bar and it worked idk why...
Report Abuse
vampirexevipex is not online. vampirexevipex
Joined: 11 Apr 2009
Total Posts: 1598
27 May 2013 06:15 PM
nvmd fixed
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