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
 

Odd problem

Previous Thread :: Next Thread 
cgjnm is not online. cgjnm
Joined: 22 Dec 2011
Total Posts: 2347
01 May 2016 03:23 PM
So when a player first dies, no value is added, however, every other time the player dies, it will add a death.

Script: (between the Xs)
game.Players.PlayerAdded:connect(function(player)
local a = Instance.new("IntValue",player)
a.Name = "leaderstats"
for i,v in pairs(stats)do
local b = Instance.new("IntValue",a)
b.Name = v
b.Value = values[i] or 0
end
for i,v in pairs(statsSave)do
local b = Instance.new("IntValue",a)
b.Name = v
_D:UpdateAsync("user_"..player.UserId..v,function(Old)
local New = Old or valuesSave[i]
return New
end)
b.Value = _D:GetAsync("user_"..player.UserId..v)
end
_D:UpdateAsync("user_"..player.UserId.."Visits",function(Old)
local New = Old or 0
New = New + 1
return New
end)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
player.CharacterAdded:connect(function(char)
char:WaitForChild("Humanoid")
char.Humanoid.Died:connect(function()
a.Deaths.Value = a.Deaths.Value + 1
end)
end)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
end)
Report Abuse
cgjnm is not online. cgjnm
Joined: 22 Dec 2011
Total Posts: 2347
01 May 2016 03:24 PM
No errors
Report Abuse
cgjnm is not online. cgjnm
Joined: 22 Dec 2011
Total Posts: 2347
01 May 2016 04:36 PM
b1
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