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
 

Is It Possible...

Previous Thread :: Next Thread 
valoo90000 is not online. valoo90000
Joined: 21 Nov 2009
Total Posts: 472
21 Sep 2014 02:45 PM
I've got a leaderboard script in my other game.

The script I'm pointing out on this post is not the leaderboard, but I want it to add on to the leaderboard.

Apparently, this script creates a new leaderstat, but I want it to add on to the current leaderstat created by the leaderboard script. I got this script from somebody else, so any help here? Thanks.


Script:

local gps = game:service'GamePassService'
game.Players.PlayerAdded:connect(function(player)
local ls = Instance.new("Model", player)
ls.Name = "leaderstats"
local money = Instance.new("IntValue", ls)
money.Name = "Cash"
if gps:PlayerHasPass(player, 178650616) then -- replace 000 with ur gamepass ID
money.Value = money.Value + 10000 -- amount of money to add if player has pass
end
end)
Report Abuse
valoo90000 is not online. valoo90000
Joined: 21 Nov 2009
Total Posts: 472
21 Sep 2014 02:49 PM
Between Lines 3-5 creates something new, but I want it to add on to the current leaderstat that already has in it, "Cash".
Report Abuse
Nyxis is not online. Nyxis
Joined: 15 Nov 2012
Total Posts: 3374
21 Sep 2014 02:53 PM
that's like the easiest thing to accomplish.. just put the part where it creates the new leaderstat in the other leaderboard script, and parent it to the leaderstats it creates
Report Abuse
valoo90000 is not online. valoo90000
Joined: 21 Nov 2009
Total Posts: 472
21 Sep 2014 03:05 PM
I'm still scratching my head... I don't get it.
Report Abuse
valoo90000 is not online. valoo90000
Joined: 21 Nov 2009
Total Posts: 472
21 Sep 2014 03:09 PM
Wait, does this work out?:


game.Players.PlayerAdded:connect(function(p)
p:WaitForChild("leaderstats")
p.leaderstats:FindFirstChild("KOs").Changed:connect(function(v)
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