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 » Scripters
Home Search
 

Re: A leaderboard

Previous Thread :: Next Thread 
xXDaredevil717Xx is not online. xXDaredevil717Xx
Joined: 06 Apr 2014
Total Posts: 21
06 Dec 2015 08:45 PM
Would this be right to make a leaderboard?

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

stats.Instance.new("Intvalue")
stats.name ="leaderstats"

wins = Instance.new("intvalue")
wins.Name = "Wins"
wins.Value = 0
wins.Parent = stats

points = Instance.new("intvalue")
points.Name = "Points"
points.Value = 100
points.Parent = stats

stats.Parent=plr

end)

If not please post what it should be in the comments.
Report Abuse
wonderful72pike is not online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
06 Dec 2015 08:48 PM
1) You spelled "IntValue" as "intvalue" two out of three times. That's gonna break the script.

2) You can set the player in the Instance.new() function like this: wins = Instance.new("IntValue", stats)

Other than that, yes this is how it's done.
Report Abuse
Crazy010517 is not online. Crazy010517
Joined: 17 Sep 2011
Total Posts: 1161
06 Dec 2015 08:49 PM
A quick look concludes that it should work.

However, I don't think you should save stats in the Player but in the ServerStorage to prevent hacking and exploiting. This will make your game much safer, BUT you will have to make your own gui to display the stats.
Report Abuse
xXDaredevil717Xx is not online. xXDaredevil717Xx
Joined: 06 Apr 2014
Total Posts: 21
06 Dec 2015 08:55 PM
Thank you guys I do not have line underlining anything anymore! :)
Report Abuse
xXDaredevil717Xx is not online. xXDaredevil717Xx
Joined: 06 Apr 2014
Total Posts: 21
06 Dec 2015 09:02 PM
Wait if you go into my game the leaderboard won't show up go into my game on my profile "Minigame Madness" (Did not want to copy loleris)
Report Abuse
xXDaredevil717Xx is not online. xXDaredevil717Xx
Joined: 06 Apr 2014
Total Posts: 21
06 Dec 2015 09:03 PM
If you go into my game the leaderboard will not show up my game is called Minigame Madness
Report Abuse
Vultorz is not online. Vultorz
Joined: 02 Mar 2015
Total Posts: 2985
06 Dec 2015 09:04 PM
Here's another leaderboard script.
Stick it into ServerScriptService.
It's a normal Script.

game.Players.PlayerAdded:connect(function(player)
stats = Instance.new("IntValue", player)
stats.Name = "leaderstats"

points = Instance.new("IntValue", stats)
points.Name = "WHATEVER YOURE NAMING IT"
end)
Report Abuse
xXDaredevil717Xx is not online. xXDaredevil717Xx
Joined: 06 Apr 2014
Total Posts: 21
06 Dec 2015 09:16 PM
So like this?


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

stats.Instance.new("IntValue")
stats.name ="leaderstats"

wins = Instance.new("IntValue", stats)
wins.Name = "Wins"
wins.Value = 0
wins.Parent = stats

points = Instance.new("IntValue", stats))
points.Name = "Points"
points.Value = 100
points.Parent = stats

stats.Parent=plr

end)
Report Abuse
xXDaredevil717Xx is not online. xXDaredevil717Xx
Joined: 06 Apr 2014
Total Posts: 21
06 Dec 2015 09:22 PM
Can somebody just paste the fixed version in the comments scripting is confusing to me. I am more of a builder.
Report Abuse
wonderful72pike is not online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
06 Dec 2015 09:22 PM
points = Instance.new("IntValue", stats))

Script-breaking line and the reason it's not showing up. You accidentally put an extra ) on the end. That'll give you a syntax error and stop the script before stats is put inside the player.
Report Abuse
wonderful72pike is not online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
06 Dec 2015 09:23 PM
Actually hang on, there may be more errors. Here's a fixed version:

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

stats = Instance.new("IntValue")
stats.Name ="leaderstats"

wins = Instance.new("IntValue", stats)
wins.Name = "Wins"
wins.Value = 0

points = Instance.new("IntValue", stats)
points.Name = "Points"
points.Value = 100

stats.Parent = plr
end)
Report Abuse
xXDaredevil717Xx is not online. xXDaredevil717Xx
Joined: 06 Apr 2014
Total Posts: 21
06 Dec 2015 09:30 PM
Thank you so much you are a big help! :]
Report Abuse
wonderful72pike is not online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
06 Dec 2015 09:33 PM
Np ^-^
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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