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
 

Leaderboard not appearing in-game

Previous Thread :: Next Thread 
DatabaseServer is not online. DatabaseServer
Joined: 16 Apr 2016
Total Posts: 30
17 May 2016 10:00 PM
Whenever I go to play the actual game ( not testing ) my leaderboard dosen't show up. This is the script:

game.Players.PlayerAdded:connect(function(plr)
local stats = Instance.new('IntValue', plr)
stats.Name = 'leaderstats'
local doritos = Instance.new('IntValue', stats)
doritos.Name = 'Doritos'
local dps = Instance.new('IntValue', stats)
dps.Name = 'DPS'
end)

I don't know why this is happening, and would appreciate some help. Thanks.
Report Abuse
Salinas23 is not online. Salinas23
Joined: 28 Dec 2008
Total Posts: 37141
17 May 2016 10:08 PM
*After reading for 18 seconds on wiki*

"1) To make a leaderboard, start by inserting an object named 'leaderstats' into each player. This should be a Model or a Folder. If you use a *Value object, like an IntValue or StringValue, this may not work)."


there is your answer
Report Abuse
Wowgnomes is not online. Wowgnomes
Joined: 27 Sep 2009
Total Posts: 26255
17 May 2016 10:09 PM
I've used an IntValue before and just more intvalues inside it and that has worked for me in the past
Report Abuse
Wowgnomes is not online. Wowgnomes
Joined: 27 Sep 2009
Total Posts: 26255
17 May 2016 10:10 PM
game.Players.PlayerAdded:connect(function(plr)
local stats = Instance.new('IntValue', plr)
stats.Name = 'leaderstats'
stats.Parent = plr
local doritos = Instance.new('IntValue', stats)
doritos.Name = 'Doritos'
doritos.Parent = stats
local dps = Instance.new('IntValue', stats)
dps.Name = 'DPS'
dps.Parent = plr
end)
Report Abuse
Wowgnomes is not online. Wowgnomes
Joined: 27 Sep 2009
Total Posts: 26255
17 May 2016 10:11 PM
but u can also do

game.Players.PlayerAdded:connect(function(plr)
local gnome = Instance.new('IntValue', plr)
gnome.Name = 'leaderstats'
gnome.Parent = plr
local gnome = Instance.new('IntValue', stats)
gnome.Name = "Doritos"
gnome.Parent = stats
local gnome = Instance.new('IntValue', stats)
gnome.Name = "DPS"
gnome.Parent = plr
end)

does not matter to me
Report Abuse
Nicollye7074 is not online. Nicollye7074
Joined: 15 Feb 2014
Total Posts: 198
17 May 2016 10:36 PM
You cannot use an IntValue because I don't know. I tried using an IntValue as a container for the leaderboard and bam, it didn't work.
Report Abuse
DatabaseServer is not online. DatabaseServer
Joined: 16 Apr 2016
Total Posts: 30
18 May 2016 04:30 PM
Now the leaderboard is appearing, but not adding value to the leaderboard when a gui is clicked.

script.Parent.MouseButton1Click:connect(function()
local d = game.Players.LocalPlayer.leaderstats.Doritos
d.Value = (d.Value + 1)
end)
Report Abuse
Wowgnomes is not online. Wowgnomes
Joined: 27 Sep 2009
Total Posts: 26255
18 May 2016 05:21 PM
script.Parent.MouseButton1Click:connect(function(player)
print("Click'd")
local d = player:findFirstChild("leaderstats")
local db = d.Doritos
db.Value = (db.Value + 1)
end)
Report Abuse
DatabaseServer is not online. DatabaseServer
Joined: 16 Apr 2016
Total Posts: 30
18 May 2016 07:04 PM
19:03:38.041 - Players.Player1.PlayerGui.Screen.BG.DoritoBG.ImageButton.GiveDoritos:2: attempt to index local 'plr' (a nil value)
Report Abuse
lululukas is not online. lululukas
Joined: 23 Aug 2010
Total Posts: 1043
18 May 2016 07:08 PM
You used plr instead of player

That is if you're using his script.
Report Abuse
DatabaseServer is not online. DatabaseServer
Joined: 16 Apr 2016
Total Posts: 30
18 May 2016 08:04 PM
It happened the same for player
Report Abuse
Wowgnomes is not online. Wowgnomes
Joined: 27 Sep 2009
Total Posts: 26255
18 May 2016 08:14 PM
post ur whole skript
Report Abuse
DatabaseServer is not online. DatabaseServer
Joined: 16 Apr 2016
Total Posts: 30
18 May 2016 08:38 PM
(PlayerAdded script)

game.Players.PlayerAdded:connect(function(plr)
local stats = Instance.new('IntValue', plr)
stats.Name = 'leaderstats'
stats.Parent = plr
local doritos = Instance.new('IntValue', stats)
doritos.Name = 'Doritos'
doritos.Parent = stats
local dps = Instance.new('IntValue', stats)
dps.Name = 'DPS'
dps.Parent = stats
end)

(Give Doritos script)

script.Parent.MouseButton1Click:connect(function(plr)
local d = plr:FindFirstChild('leaderstats')
local dr = d.Doritos
dr.Value = (dr.Value + 1)
end)

(Error)

20:38:22.383 - Players.Player1.PlayerGui.Screen.BG.DoritoBG.ImageButton.GiveDoritos:2: attempt to index local 'plr' (a nil value)
Report Abuse
DatabaseServer is not online. DatabaseServer
Joined: 16 Apr 2016
Total Posts: 30
18 May 2016 09:00 PM
b
Report Abuse
TheBenSquare is not online. TheBenSquare
Joined: 13 Dec 2009
Total Posts: 13604
18 May 2016 09:28 PM
MouseButton1Click and MouseButton1Down don't return the player. Assuming that this is a server script, you need to just use a local script for the GUI.
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