|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 06 Dec 2015 08:55 PM |
| Thank you guys I do not have line underlining anything anymore! :) |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 06 Dec 2015 09:30 PM |
| Thank you so much you are a big help! :] |
|
|
| Report Abuse |
|
|
| |
|