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: Save Kills Script

Previous Thread :: Next Thread 
pieinyofaceha is not online. pieinyofaceha
Joined: 09 May 2012
Total Posts: 2367
31 Jan 2013 05:16 PM
I've attempted scripting them three times, it didn't work. I asked two scripting experts, neither of their suggestions worked either.

Does anyone mind telling me a good script of saving kills when you leave and come back?

A helpful response would be appriciated. Thanks for reading.
Report Abuse
YellowBrick1 is not online. YellowBrick1
Joined: 06 May 2009
Total Posts: 865
31 Jan 2013 05:18 PM
Use DP.

player:SaveNumber("kills", 5) -- Change '5' to the number of kills to be saved.
Report Abuse
pieinyofaceha is not online. pieinyofaceha
Joined: 09 May 2012
Total Posts: 2367
31 Jan 2013 05:21 PM
Was I overthinking it? Is that the entire script? And by the way I need it to save wipeouts as well.
Report Abuse
Quenty is not online. Quenty
Joined: 03 Sep 2009
Total Posts: 9316
31 Jan 2013 05:22 PM
No. You need to understand a bit on how leaderboards work...

http://wiki.roblox.com/index.php/Leaderboards

But your solution is data persistance.
Report Abuse
pieinyofaceha is not online. pieinyofaceha
Joined: 09 May 2012
Total Posts: 2367
31 Jan 2013 05:35 PM
Well I know leader-boarding, and that link doesn't help, but thank you for your support.
Anyone have a script/advice I can use?
Report Abuse
pieinyofaceha is not online. pieinyofaceha
Joined: 09 May 2012
Total Posts: 2367
31 Jan 2013 05:40 PM
Bump?
Report Abuse
crouton04 is not online. crouton04
Joined: 07 Jul 2010
Total Posts: 4459
31 Jan 2013 05:43 PM
[ Content Deleted ]
Report Abuse
pieinyofaceha is not online. pieinyofaceha
Joined: 09 May 2012
Total Posts: 2367
31 Jan 2013 05:47 PM
Nice post ._.

Bump2.
Report Abuse
pieinyofaceha is not online. pieinyofaceha
Joined: 09 May 2012
Total Posts: 2367
31 Jan 2013 05:53 PM
Hope I don't sound like a noob with my bumps.

Bump3
Report Abuse
pieinyofaceha is not online. pieinyofaceha
Joined: 09 May 2012
Total Posts: 2367
31 Jan 2013 06:01 PM
C'mon, please post? I really need help with this.
Report Abuse
freerunner1234 is not online. freerunner1234
Joined: 23 Nov 2008
Total Posts: 2078
31 Jan 2013 06:03 PM
Don't double post. This should work:

game.Players.PlayerAdded:connect(function(player)
local stats=Instance.new("IntValue", player)
stats.Name=="leaderstats"
local s1=Instance.new("IntValue", stats)
local s2=Instance.new("IntValue", stats)
s1.Name, s2.Name="KOs", "WOs"
if player.DataReady==true then
s1.Value=player:LoadNumber("KOs")
s2.Value=player:LoadNumber("WOs player.leaderstats.WOs)
elseif player.DataReady==false then
player:WaitForDataReady()
s1.Value=player:LoadNumber("KOs")
s2.Value=player:LoadNumber("WOs")
end
coroutine.resume(coroutine.create(function()
while true do
if player.DataReady==true then
player:SaveNumber("KOs", player.leaderstats.KOs.Value)
player:SaveNumber("WOs", player.leaderstats.WOs.Value)
elseif player.DataReady==false then
player:WaitForDataReady()
player:SaveNumber("KOs", player.leaderstats.KOs.Value)
player:SaveNumber("WOs", player.leaderstats.WOs.Value)
end
Wait(180)
end end))
end)
Report Abuse
freerunner1234 is not online. freerunner1234
Joined: 23 Nov 2008
Total Posts: 2078
31 Jan 2013 06:04 PM
There may be minor errors in that script, but they should be easily fixable through the output. The point is that that is what you're trying to do.
Report Abuse
pieinyofaceha is not online. pieinyofaceha
Joined: 09 May 2012
Total Posts: 2367
31 Jan 2013 06:10 PM
A couple questions.

1. Does the wait(180) at the end have to be 180?

2. I fixed a few bugs, then it gave me an error that says:
Workspace.Script:9: unfinished string near '"WOs player.leaderstats.WOs)'

Did you mean to have a string or not? I'm asking because of the one ".
Report Abuse
freerunner1234 is not online. freerunner1234
Joined: 23 Nov 2008
Total Posts: 2078
31 Jan 2013 06:13 PM
--No, it does not have to have the 180 remain 180. I recommend going by 30 second intervals at most though. Also, the error you said should be fixed.

game.Players.PlayerAdded:connect(function(player)
local stats=Instance.new("IntValue", player)
stats.Name=="leaderstats"
local s1=Instance.new("IntValue", stats)
local s2=Instance.new("IntValue", stats)
s1.Name, s2.Name="KOs", "WOs"
if player.DataReady==true then
s1.Value=player:LoadNumber("KOs")
s2.Value=player:LoadNumber("WOs")
elseif player.DataReady==false then
player:WaitForDataReady()
s1.Value=player:LoadNumber("KOs")
s2.Value=player:LoadNumber("WOs")
end
coroutine.resume(coroutine.create(function()
while true do
if player.DataReady==true then
player:SaveNumber("KOs", player.leaderstats.KOs.Value)
player:SaveNumber("WOs", player.leaderstats.WOs.Value)
elseif player.DataReady==false then
player:WaitForDataReady()
player:SaveNumber("KOs", player.leaderstats.KOs.Value)
player:SaveNumber("WOs", player.leaderstats.WOs.Value)
end
Wait(180)
end end)) end)
Report Abuse
pieinyofaceha is not online. pieinyofaceha
Joined: 09 May 2012
Total Posts: 2367
31 Jan 2013 06:20 PM
Now the WOs don't show up.
Report Abuse
freerunner1234 is not online. freerunner1234
Joined: 23 Nov 2008
Total Posts: 2078
31 Jan 2013 06:28 PM
Accidentally added an extra = in the leaderstats name. Debugging your scripts in studio 2.0 helps, it has a live error checker.

game.Players.PlayerAdded:connect(function(player)
local stats=Instance.new("IntValue", player)
stats.Name="leaderstats"
local s1=Instance.new("IntValue", stats)
local s2=Instance.new("IntValue", stats)
s1.Name, s2.Name="KOs", "WOs"
if player.DataReady==true then
s1.Value=player:LoadNumber("KOs")
s2.Value=player:LoadNumber("WOs")
elseif player.DataReady==false then
player:WaitForDataReady()
s1.Value=player:LoadNumber("KOs")
s2.Value=player:LoadNumber("WOs")
end
coroutine.resume(coroutine.create(function()
while true do
if player.DataReady==true then
player:SaveNumber("KOs", player.leaderstats.KOs.Value)
player:SaveNumber("WOs", player.leaderstats.WOs.Value)
elseif player.DataReady==false then
player:WaitForDataReady()
player:SaveNumber("KOs", player.leaderstats.KOs.Value)
player:SaveNumber("WOs", player.leaderstats.WOs.Value)
end
Wait(180)
end end)) end)
Report Abuse
pieinyofaceha is not online. pieinyofaceha
Joined: 09 May 2012
Total Posts: 2367
31 Jan 2013 06:46 PM
Now the WOs don't change when I die. Not sure about KOs, I don't have a player to test it with me.
Report Abuse
freerunner1234 is not online. freerunner1234
Joined: 23 Nov 2008
Total Posts: 2078
31 Jan 2013 06:50 PM
The actual script isn't functional when you kill or die. That has to happen on your part. All you asked for was a script that saves stats. Not one that updates them.
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