walky3
|
  |
| Joined: 26 Nov 2008 |
| Total Posts: 1415 |
|
|
| 27 Jan 2013 04:12 AM |
print("Leaderboard script loaded")
function onPlayerEntered(newPlayer)
local stats = Instance.new("IntValue") stats.Name = "leaderstats"
local mins = Instance.new("IntValue") mins.Name = "Crims" mins.Value = 100
mins.Parent = stats stats.Parent = newPlayer
while true do wait(60) . mins.Value = mins.Value + 25 end end
game.Players.ChildAdded:connect(onPlayerEntered) |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 27 Jan 2013 04:20 AM |
I'm not going to implement it, but it looks like you want to save a number of 'Crims'.
game.Players.PlayerAdded:connect( function(plr) plr:WaitUntilDataReady() --I kinda forgot this line. Feel free to corerct me. plr:SaveNumber(plr.leaderstats.Crims.Value, "Crims") end )
It should be somthing like that to save your Crims value. |
|
|
| Report Abuse |
|
|
crouton04
|
  |
| Joined: 07 Jul 2010 |
| Total Posts: 4459 |
|
|
| 27 Jan 2013 04:21 AM |
game.Players.PlayerAdded:connect(function(p) p:WaitForDataReady() p:LoadNumber("crims") end)
game.Players.PlayerRemoving:connect(function(P) P:WaitForDataReady() P:SaveNumber("crims", mins.Value) end)
function onPlayerEntered(newPlayer)
local stats = Instance.new("IntValue") stats.Name = "leaderstats"
local mins = Instance.new("IntValue") mins.Name = "Crims" mins.Value = 100
mins.Parent = stats
stats.Parent = newPlayer
while true do wait(60) . mins.Value = mins.Value + 25 end end
game.Players.ChildAdded:connect(onPlayerEntered) |
|
|
| Report Abuse |
|
|
walky3
|
  |
| Joined: 26 Nov 2008 |
| Total Posts: 1415 |
|
|
| 27 Jan 2013 04:35 AM |
| Crouton that didn't work? I want it so when I re-enter the place I have the same amount of 'Crims' as I had when I was first at it. |
|
|
| Report Abuse |
|
|
walky3
|
  |
| Joined: 26 Nov 2008 |
| Total Posts: 1415 |
|
| |
|
gerit99
|
  |
| Joined: 21 Jul 2010 |
| Total Posts: 521 |
|
|
| 27 Jan 2013 04:47 AM |
game.Players.PlayerRemoving:connect(function(P) P:WaitForDataReady() P:SaveNumber("crims", p.Crims.Value) end)
function onPlayerEntered(newPlayer)
local stats = Instance.new("IntValue") stats.Name = "leaderstats"
local mins = Instance.new("IntValue") mins.Name = "Crims" mins.Value = 100 p:WaitForDataReady() if p:LoadNumber("crims") ~= 0 then mins.Value = p:LoadNumber("crims") end
mins.Parent = stats
stats.Parent = newPlayer
while true do wait(60) . mins.Value = mins.Value + 25 end end
game.Players.ChildAdded:connect(onPlayerEntered) |
|
|
| Report Abuse |
|
|
Zanziber
|
  |
| Joined: 08 Dec 2008 |
| Total Posts: 5088 |
|
|
| 01 Feb 2013 11:13 AM |
| Still none of them work... |
|
|
| Report Abuse |
|
|
walky3
|
  |
| Joined: 26 Nov 2008 |
| Total Posts: 1415 |
|
|
| 02 Feb 2013 04:59 AM |
| ^How to make this work with new ROBLOX |
|
|
| Report Abuse |
|
|
Combrad
|
  |
| Joined: 18 Jul 2009 |
| Total Posts: 11025 |
|
|
| 02 Feb 2013 05:04 AM |
game.Players.PlayerAdded;connect(function (pl) pl:WaitForDataReady() local cr = pl;LoadNumber("Crims") local ls = Instance.new("IntValue",pl) ls.Name = "leaderstats" local c = Instance.new("IntValue",ls) c.Name = "Crims" c.Value = cr > 100 and cr or 100 while wait(60) do c.Value = c.Value+25 pl:SaveNumber("Crims",c.Value) end end) |
|
|
| Report Abuse |
|
|
Zanziber
|
  |
| Joined: 08 Dec 2008 |
| Total Posts: 5088 |
|
|
| 02 Feb 2013 05:21 AM |
| That still dosn't work, I think its the first line thats wrong? |
|
|
| Report Abuse |
|
|
Zanziber
|
  |
| Joined: 08 Dec 2008 |
| Total Posts: 5088 |
|
| |
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 02 Feb 2013 05:25 AM |
| Yes. That's right. combrad must have accidently typed ';' instead of ':'. It should work if you replace it with the ':' |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 02 Feb 2013 05:26 AM |
Also here:
al cr = pl;LoadNumber("Crims")
Replace the ';' with a ':' |
|
|
| Report Abuse |
|
|
Zanziber
|
  |
| Joined: 08 Dec 2008 |
| Total Posts: 5088 |
|
|
| 02 Feb 2013 05:44 AM |
| It still wont show up ingame D: :L |
|
|
| Report Abuse |
|
|
Combrad
|
  |
| Joined: 18 Jul 2009 |
| Total Posts: 11025 |
|
|
| 02 Feb 2013 05:45 AM |
Oh, sorry about that. I'd only just got up and was in a rush to type it. |
|
|
| Report Abuse |
|
|
Zanziber
|
  |
| Joined: 08 Dec 2008 |
| Total Posts: 5088 |
|
|
| 02 Feb 2013 05:46 AM |
| I tryed Digpoes fix but the leaderboard just refuses to show up ingame |
|
|
| Report Abuse |
|
|
Zanziber
|
  |
| Joined: 08 Dec 2008 |
| Total Posts: 5088 |
|
| |
|
Zanziber
|
  |
| Joined: 08 Dec 2008 |
| Total Posts: 5088 |
|
| |
|
Zanziber
|
  |
| Joined: 08 Dec 2008 |
| Total Posts: 5088 |
|
| |
|
Zanziber
|
  |
| Joined: 08 Dec 2008 |
| Total Posts: 5088 |
|
|
| 03 Feb 2013 07:20 AM |
| Please someone just help me with this. |
|
|
| Report Abuse |
|
|