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: SMALL PROBLEM WITH 'TOSTRING'

Previous Thread :: Next Thread 
DevSwordfish is not online. DevSwordfish
Joined: 21 Mar 2012
Total Posts: 231
20 Aug 2014 06:13 PM
Okay, so I want 'tostring' for multiple variables, but I'm having trouble. Please help me!

Here is the line of code I want it in:

game.Players.LocalPlayer.PlayerGui.CookieNotificator.TextLabel.Text = tostring(CookieNotificator) - tostring(Price)
Report Abuse
LordMatthewII is not online. LordMatthewII
Joined: 20 Aug 2011
Total Posts: 10873
20 Aug 2014 06:15 PM
tostring(CookieNotificator) - tostring(Price)

Your basicly doing..
fart-banana=dog
here

What you should do is..

local sting=tostring(CookieNotificator-Price)
Report Abuse
DevSwordfish is not online. DevSwordfish
Joined: 21 Mar 2012
Total Posts: 231
20 Aug 2014 09:38 PM
Should I replace it, or put it above it?
Report Abuse
iiEssence is not online. iiEssence
Joined: 18 Jun 2014
Total Posts: 3467
20 Aug 2014 09:41 PM
You can't subtract strings.
Report Abuse
DevSwordfish is not online. DevSwordfish
Joined: 21 Mar 2012
Total Posts: 231
20 Aug 2014 09:43 PM
WHOOPSY my bad XD
Report Abuse
cooldude999921 is not online. cooldude999921
Joined: 13 Aug 2011
Total Posts: 3702
20 Aug 2014 09:43 PM
plr = game.Players.LocalPlayer
value = CookieNotificator - Price
stringvalue = tostring(value)

plr.PlayerGui.CookieNotificator.TextLabel.Text = stringvalue
Report Abuse
DevSwordfish is not online. DevSwordfish
Joined: 21 Mar 2012
Total Posts: 231
20 Aug 2014 09:44 PM
so no strings for me :(
Report Abuse
DevSwordfish is not online. DevSwordfish
Joined: 21 Mar 2012
Total Posts: 231
20 Aug 2014 09:45 PM
never mind!
Report Abuse
DevSwordfish is not online. DevSwordfish
Joined: 21 Mar 2012
Total Posts: 231
20 Aug 2014 09:46 PM
nope :/
Report Abuse
DevSwordfish is not online. DevSwordfish
Joined: 21 Mar 2012
Total Posts: 231
20 Aug 2014 09:48 PM
hold on, i have a better idea
Report Abuse
DevSwordfish is not online. DevSwordfish
Joined: 21 Mar 2012
Total Posts: 231
20 Aug 2014 09:50 PM
still didn't work :/

Lemme add the 'tostring'...
Report Abuse
DevSwordfish is not online. DevSwordfish
Joined: 21 Mar 2012
Total Posts: 231
20 Aug 2014 09:51 PM
Will this work?:

ClickPowerUpgrade = 3
Price = 300

script.Parent.MouseButton1Down:connect(function()
if Cookies >= 300 then
game.Soundscape.Ping:Play()
tostring(Cookies)
tostring(Price)
Cookies = Cookies - Price
game.Players.LocalPlayer.PlayerGui.CookieNotificator.TextLabel.Text = CookieNotificator
ClickPower = ClickPowerUpgrade + ClickPower
Price = Price + Price
game.Players.LocalPlayer.PlayerGui.ClickPower.TextButton.Text = "Click Power - "..Price.."Cookies"
end
end)
Report Abuse
KOTwarrior is not online. KOTwarrior
Joined: 13 Jun 2012
Total Posts: 4376
20 Aug 2014 09:52 PM
if you were trying to pair those two, use the .. operator.

game.Players.LocalPlayer.PlayerGui.CookieNotificator.TextLabel.Text = tostring(CookieNotificator) .. tostring(Price)
Report Abuse
DevSwordfish is not online. DevSwordfish
Joined: 21 Mar 2012
Total Posts: 231
20 Aug 2014 09:54 PM
are you sure that will subtract it?
Report Abuse
DevSwordfish is not online. DevSwordfish
Joined: 21 Mar 2012
Total Posts: 231
20 Aug 2014 09:56 PM
nope, doesn't work. :(
Report Abuse
LordMatthewII is not online. LordMatthewII
Joined: 20 Aug 2011
Total Posts: 10873
20 Aug 2014 10:09 PM
Just use mine.
Report Abuse
DevSwordfish is not online. DevSwordfish
Joined: 21 Mar 2012
Total Posts: 231
20 Aug 2014 11:28 PM
I did, but should I replace the previous line of code, or put it right above it?
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