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: y cant i make a simple leaderboard!!!

Previous Thread :: Next Thread 
tdur is not online. tdur
Joined: 19 Aug 2016
Total Posts: 2557
04 Sep 2016 07:01 PM
game.Players.PlayerAdded:connect(function(p)
local ls = Instance.new('Model')
ls.Name = 'leaderstats'
ls.Parent = p

for _,o in pairs (o) do
Instance.new('IntValue', ls).Name = o
end


--Kill Control
p.leaderstats.Kills.Value = 0
p.CharacterAdded:connect(function(char)
char:WaitForChild('Humanoid').Died:connect(function()
local creator = p.Character.Humanoid:FindFirstChild('creator')
if(creator~=nil)then
local killer = creator.Value
killer.leaderstats.Kills.Value = killer.leaderstats.Kills.Value + 1
end
local key = "player -"..p.userId
local data = ds:GetAsync(key)
if(data)then
o.Kills.Value = data[1]
o.Deaths.Value = data[2]
else
local sf = {o.Kills.Value,o.Deaths.Value}
ds:SetAsync(key,sf)
end
--Death Control
p.leaderstats.Deaths.Value = 0
p.leaderstats:FindFirstChild('Deaths').Value = p.Deaths.value + 1
end)
end)
end)

game.Players.PlayerRemoving:connect(function(p)
local key = "player - "..p.userId
local v = {p.leaderstats.Kills.Value, p.leaderstats.Deaths.Value}
ds:SetAsync(key,v)
end)


line 30; attempt to index field 'Kills' (a nil value)

how tho

line 30 = local sf = {o.Kills.Value,o.Deaths.Value}

@ beginning o = {"Kills","Deaths"}

im new to lua so idk what im doing wrong o3o


#code print(R$5,848)
Report Abuse
TechnoUser is not online. TechnoUser
Joined: 09 May 2010
Total Posts: 400
04 Sep 2016 07:01 PM
because you're #### m8
Report Abuse
tdur is not online. tdur
Joined: 19 Aug 2016
Total Posts: 2557
04 Sep 2016 07:04 PM
because im hash


#code print(R$5,848)
Report Abuse
TechnoUser is not online. TechnoUser
Joined: 09 May 2010
Total Posts: 400
04 Sep 2016 07:05 PM
yes
Report Abuse
tdur is not online. tdur
Joined: 19 Aug 2016
Total Posts: 2557
05 Sep 2016 12:48 AM
ok


#code print(R$5,863)
Report Abuse
tdur is not online. tdur
Joined: 19 Aug 2016
Total Posts: 2557
05 Sep 2016 11:08 AM
asdf


#code print(R$5,613)
Report Abuse
tdur is not online. tdur
Joined: 19 Aug 2016
Total Posts: 2557
05 Sep 2016 11:25 AM
broe o3o


#code print(R$5,613)
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