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: Variables in text??

Previous Thread :: Next Thread 
Raildex is not online. Raildex
Joined: 06 Dec 2009
Total Posts: 934
16 Apr 2015 06:14 PM
How do you implement variables into text? this is my attempt..

gas = 1000

while true do
gas = gas +1
wait(1)
script.Parent.BillboardGui.gas.Text = "Gas: " + gas
end
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
16 Apr 2015 06:15 PM
Use .. instead of +
Report Abuse
Lecturous is not online. Lecturous
Joined: 17 Aug 2013
Total Posts: 1096
16 Apr 2015 06:16 PM
he probably just came from JS or Java

~ Post by Lecturous ~
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
16 Apr 2015 06:18 PM
Every language I can think of uses + as its concatenation operator but Lua, so I'm not surprised. C# uses +, I think C and C++ do too (Not positive), Python does, etc.
Report Abuse
nomer888 is not online. nomer888
Joined: 13 Feb 2010
Total Posts: 551
16 Apr 2015 06:30 PM
C doesn't have a concatenation operator. Strings are just character arrays. There's a 'strcat' function, however.

C++ has std::string that uses the addition operator to concatenate strings. Otherwise, it's the same as C.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
16 Apr 2015 06:33 PM
strcat doesn't look like it creates a new string though, you would have to take 2 steps :(
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