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: Leaderboard script not working?

Previous Thread :: Next Thread 
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
18 Aug 2014 08:10 PM
game.Players.PlayerAdded:connect(function(player)
stats = Instance.new("IntValue", player)
stats.Name = "leaderstats"
Points = Instance.new("IntValue", leaderstats)
Points.Name = "Points"
Points.Value = 0
asdf = Instance.new("IntValue", leaderstats)
asdf.Name = "Total Points"
asdf.Value = 0
end)
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
18 Aug 2014 08:12 PM
bump
Report Abuse
XXahraternotXX is not online. XXahraternotXX
Joined: 03 Jan 2009
Total Posts: 221
18 Aug 2014 08:13 PM
--Try:

game.Players.PlayerAdded:connect(function(player)
stats = Instance.new("IntValue")
stats.Name = "leaderstats"
Points = Instance.new("IntValue", stats)
Points.Name = "Points"
Points.Value = 0
asdf = Instance.new("IntValue", stats)
asdf.Name = "Total Points"
asdf.Value = 0
stats.Parent = player
end)
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
18 Aug 2014 08:13 PM
output? What do you see? What do you not see?
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
18 Aug 2014 08:18 PM
No output and @XX didn't work
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
18 Aug 2014 08:19 PM
What do you see? What do you not see?
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
18 Aug 2014 08:21 PM
@Pre Nothing, thats why I bothered to reply again
Report Abuse
EgoMoose is not online. EgoMoose
Joined: 04 Feb 2009
Total Posts: 2896
18 Aug 2014 08:21 PM
You need to let the character load first.

game.Players.PlayerAdded:connect(function(player)
repeat wait() until player.Character ~= nil

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

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

asdf = Instance.new("IntValue", stats)
asdf.Name = "Total Points"
asdf.Value = 0
end)
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
18 Aug 2014 08:24 PM
@Moose Didn't work
Report Abuse
XXahraternotXX is not online. XXahraternotXX
Joined: 03 Jan 2009
Total Posts: 221
18 Aug 2014 08:30 PM
I don't understand why mine didn't work.

Where is the script located?
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
18 Aug 2014 08:31 PM
Workspace
Report Abuse
TheBenSquare is not online. TheBenSquare
Joined: 13 Dec 2009
Total Posts: 13604
18 Aug 2014 08:32 PM
I've tried that before, strangely those scripts broke. I used a free model, copy/pasted the source code into another script and the new one didn't work. I'd just find a free model, fresh ones broke for some reason. And yes, I hate using free models too.
Report Abuse
EgoMoose is not online. EgoMoose
Joined: 04 Feb 2009
Total Posts: 2896
18 Aug 2014 08:35 PM
What type of script are you using?
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
18 Aug 2014 08:35 PM
Regular
Report Abuse
XXahraternotXX is not online. XXahraternotXX
Joined: 03 Jan 2009
Total Posts: 221
18 Aug 2014 08:37 PM
-- I gave it another try, this is how I would do it

function OnEnter(plr)

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

p = Instance.new("NumberValue")
p.Name = "Points"
p.Value = 0
p.Parent = stats

a = Instance.new("NumberValue")
a.Name = "Total Points"
a.Value = 0
a.Parent = stats

stats.Parent = plr

game.Players.PlayerAdded:connect(OnEnter)
Report Abuse
EgoMoose is not online. EgoMoose
Joined: 04 Feb 2009
Total Posts: 2896
18 Aug 2014 08:37 PM
Hmm, well then it should be working.

You could try increasing the yield time. I think in the standard roblox leaderboards they wait 5 seconds.

As a side note, I know mine works I tested it before I posted it. So now it's just a matter of why it isn't working for you :D
Report Abuse
tardysauce is not online. tardysauce
Joined: 05 May 2012
Total Posts: 8444
18 Aug 2014 09:18 PM
bump
Report Abuse
ModDeathRally9 is not online. ModDeathRally9
Joined: 02 Sep 2012
Total Posts: 370
18 Aug 2014 09:27 PM
game.Players.PlayerAdded:connect(function(player)
local stats = Instance.new("Model", player)
stats.Name = "leaderstats"
local points = Instance.new("IntValue", stats)
points.Name = "Points"
points.Value = 0
end)

Regular script; place in Workspace.
You had the actual stats good, but not the leaderstats object.
Add more stats the way you were the ones you had. leaderstats is a Model.
Make sure you are using the right value. ie, StringValue, IntValue. Don't know if you can use BoolValue in leaderstats...
Report Abuse
ModDeathRally9 is not online. ModDeathRally9
Joined: 02 Sep 2012
Total Posts: 370
18 Aug 2014 09:29 PM
Xx, that's very inefficient.
Report Abuse
XXahraternotXX is not online. XXahraternotXX
Joined: 03 Jan 2009
Total Posts: 221
18 Aug 2014 09:33 PM
@Mod

Well I am old school
Report Abuse
ModDeathRally9 is not online. ModDeathRally9
Joined: 02 Sep 2012
Total Posts: 370
18 Aug 2014 09:39 PM
@Xx lol not sayin it's bad, it's just a little bit slower and sloppier.
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