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: How to make this save?

Previous Thread :: Next Thread 
walky3 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. walky3
Joined: 26 Nov 2008
Total Posts: 1415
27 Jan 2013 04:41 AM
bump
Report Abuse
gerit99 is not online. 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 is not online. Zanziber
Joined: 08 Dec 2008
Total Posts: 5088
01 Feb 2013 11:13 AM
Still none of them work...
Report Abuse
walky3 is not online. 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 is not online. 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 is not online. 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 is not online. Zanziber
Joined: 08 Dec 2008
Total Posts: 5088
02 Feb 2013 05:25 AM
Bump.
Report Abuse
digpoe is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. Zanziber
Joined: 08 Dec 2008
Total Posts: 5088
02 Feb 2013 06:27 AM
bumpd
Report Abuse
Zanziber is not online. Zanziber
Joined: 08 Dec 2008
Total Posts: 5088
02 Feb 2013 06:56 AM
bumplol
Report Abuse
Zanziber is not online. Zanziber
Joined: 08 Dec 2008
Total Posts: 5088
02 Feb 2013 01:02 PM
...
Report Abuse
Zanziber is not online. Zanziber
Joined: 08 Dec 2008
Total Posts: 5088
03 Feb 2013 07:20 AM
Please someone just help me with this.
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