|
| 05 Jun 2013 01:43 PM |
I am trying to script a leaderboard that has two stats, one Dollars and one Bank. i was successful in making said leaderboard. I made a second script inside the leaderboard script that would add money to the Dollars stat every half a minute. i tested the script in roblox studio and it worked perfectly, but when i uploaded it to this account's place, instead of the place it was meant for on my alt account, it did not work. Why is that?
here is the add money script i used. can you tell me what is missing to make it work online?
while wait(30) do game.Players.LocalPlayer.leaderstats["Dollars"].Value=game.Players.LocalPlayer.leaderstats["Dollars"].Value+150 end |
|
|
| Report Abuse |
|
|
monster07
|
  |
| Joined: 19 Jul 2009 |
| Total Posts: 533 |
|
|
| 05 Jun 2013 01:45 PM |
| When u copy games over make sure to save as then open in your new place and not to select everything and save selection to Roblox or make it a model. If you do this is wont work. |
|
|
| Report Abuse |
|
|
|
| 05 Jun 2013 01:47 PM |
| im not copying my game over. on this account i have an empty baseplate with some random bricks i also used for testing. i scripted it on this place in roblox studio as well |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 Jun 2013 02:15 PM |
1) scripts will work the same on ANY account the same way..
my guess is that you probably have something wrong with the leaderboard on the place or have a different leaderboard[updated?] on your other account. |
|
|
| Report Abuse |
|
|
|
| 05 Jun 2013 02:20 PM |
| its not on my other place. what i mean is when i test it in roblox studio, it works but after i upload it to roblox and play it on roblox, it doesnt |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 Jun 2013 02:37 PM |
your new leaderboard put in a script in workspace
game.Players.PlayerAdded:connect(function(player() local stats = Instance.new("IntValue", player) stats.Name = "leaderstats" local doll = Instance.new("IntValue", stats) doll.Name = Dollars doll.Value = 0 local bank = Instance.new("IntValue", stats) bank.Name = Bank bank.Value = 0 local A = script.MONEYSCRIPT:clone() A.Parent = player A.Disable = false end)
------------------------------------------------------------------------------------ your new money script put inside a script inside the leaderboard and disable it
while true do lol = script.Parent:findFirstChild("leaderstats") if lol ~= nil then lol.Dollars.Value = lol.Dollars.Value + 150 wait(30) end end |
|
|
| Report Abuse |
|
|
ForceSky
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 2379 |
|
|
| 05 Jun 2013 02:39 PM |
| LocalPlayer only works in LocalScripts, only working in the Player. |
|
|
| Report Abuse |
|
|
|
| 05 Jun 2013 02:40 PM |
| @above thats what i thought but i dont know much about localplayer so i didnt say anything :3 |
|
|
| Report Abuse |
|
|