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 is wrong with this line?

Previous Thread :: Next Thread 
yelloball is not online. yelloball
Joined: 17 Feb 2010
Total Posts: 2749
28 Dec 2013 04:27 PM
script.Parent.cash.Text = (tostring(NewValue).."$")


Doesnt seem to work.
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
28 Dec 2013 04:28 PM
You don't need tostring, but that shouldn't break it either..
Report Abuse
yelloball is not online. yelloball
Joined: 17 Feb 2010
Total Posts: 2749
28 Dec 2013 04:31 PM
NewValue is a numbervalue.
Report Abuse
PerpetualMovement is not online. PerpetualMovement
Joined: 04 Dec 2012
Total Posts: 1001
28 Dec 2013 04:32 PM
script.Parent.cash.Text = NewValue .. "$"

That should work, you don't need to use tostring.
Report Abuse
yelloball is not online. yelloball
Joined: 17 Feb 2010
Total Posts: 2749
28 Dec 2013 04:36 PM
I don't know why it stopped working then.
Can you give it a shot?

game.Players.PlayerAdded:connect(function(p)
if p:WaitForDataReady() then
folder = Instance.new("Configuration",p)
folder.Name = "Stats"
money = Instance.new("NumberValue",folder)
money.Name = "Money"
money.Value = p:LoadNumber("Money")
money.Changed:connect(function(NewValue)
p:SaveNumber("Money", NewValue)
script.Parent.cash.Text = NewValue .. "$"
end)
end

while true do
money.Value = money.Value + 100
wait(1440)
end
end)
Report Abuse
PerpetualMovement is not online. PerpetualMovement
Joined: 04 Dec 2012
Total Posts: 1001
28 Dec 2013 04:39 PM
Where is this script? In the workspace?
Report Abuse
btft is not online. btft
Joined: 19 Feb 2011
Total Posts: 1512
28 Dec 2013 04:40 PM
Output?


And to make it more efficient.
while wait(1440) do
money.Value = money.Value + 100
end)
Report Abuse
yelloball is not online. yelloball
Joined: 17 Feb 2010
Total Posts: 2749
28 Dec 2013 04:42 PM
No output.
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
28 Dec 2013 04:43 PM
Why does this have a closed parenthesis?


while true do
money.Value = money.Value + 100
wait(1440)
end
end) <----
Report Abuse
PerpetualMovement is not online. PerpetualMovement
Joined: 04 Dec 2012
Total Posts: 1001
28 Dec 2013 04:43 PM
Are you testing this in Solo? PlayerAdded doesn't work in Solo.

Go to
http://wiki.roblox.com/index.php/PlayerAdded_(Event)
to learn how to use that event in solo.
Report Abuse
btft is not online. btft
Joined: 19 Feb 2011
Total Posts: 1512
28 Dec 2013 04:43 PM
Are you testing it in game? Or just in solo? PlayerAdded doesn't work in solo.
Report Abuse
PerpetualMovement is not online. PerpetualMovement
Joined: 04 Dec 2012
Total Posts: 1001
28 Dec 2013 04:44 PM
@Azarth

game.Players.PlayerAdded:connect(function(p)

He needed to close the function if you didn't see that.
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
28 Dec 2013 04:46 PM
Oh, yeah I didn't see that.
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
28 Dec 2013 04:47 PM
If its a hint/message it should be Text otherwise it should be Value
Report Abuse
yelloball is not online. yelloball
Joined: 17 Feb 2010
Total Posts: 2749
28 Dec 2013 04:47 PM
23:47:18.945 - Players.Player1.PlayerGui.Money.MoneyScript:18: attempt to call global 'PlayerAdded' (a nil value)
Report Abuse
btft is not online. btft
Joined: 19 Feb 2011
Total Posts: 1512
28 Dec 2013 04:48 PM
Put this at the end of your script.
for _, player in pairs(game.Players:GetPlayers()) do PlayerAdded(player) end
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
28 Dec 2013 04:49 PM
Don't put that script in PlayerGui..
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
28 Dec 2013 04:49 PM
StarterGui*
Report Abuse
btft is not online. btft
Joined: 19 Feb 2011
Total Posts: 1512
28 Dec 2013 04:50 PM
owait i diddn't realize it was there.
Report Abuse
yelloball is not online. yelloball
Joined: 17 Feb 2010
Total Posts: 2749
28 Dec 2013 04:53 PM
@btft
Already done that.

This is my explorer.
game
-Workspace
-Lighting
-PlayerGui
--Money
---MoneyScript
---cash
-Starterpack
Report Abuse
btft is not online. btft
Joined: 19 Feb 2011
Total Posts: 1512
28 Dec 2013 04:54 PM
Is Moneyscript a localscript?
Report Abuse
btft is not online. btft
Joined: 19 Feb 2011
Total Posts: 1512
28 Dec 2013 04:55 PM
Hm? repeat wait() until script.Parent.Parent ??
Report Abuse
btft is not online. btft
Joined: 19 Feb 2011
Total Posts: 1512
28 Dec 2013 04:55 PM
.Parent
Report Abuse
yelloball is not online. yelloball
Joined: 17 Feb 2010
Total Posts: 2749
28 Dec 2013 04:59 PM
It's a normal script.
Report Abuse
yelloball is not online. yelloball
Joined: 17 Feb 2010
Total Posts: 2749
28 Dec 2013 05:12 PM
What did you mean with repeat wait() until script.Parent.Parent ?
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