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: Stats help.

Previous Thread :: Next Thread 
TeamZeplin is not online. TeamZeplin
Joined: 09 Jul 2011
Total Posts: 76
10 Jul 2014 01:03 PM
I am making stats for my game first adding the leader boards then plan to make it show the stats on another gui. but i can not figure out two things how to add multiple leader stats i'm adding ki agility and attack and how to make it show on another gui. this is the code i'm using currently.

function playerAdded(plr)

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

local Ki = Instance.new("IntValue", stats)
Ki.Name = "Ki"
Ki.Value = 100
end

game.Players.PlayerAdded:connect(playerAdded)
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
10 Jul 2014 01:08 PM
whats with everyone doing ki agility and attack
Report Abuse
rockshe1000 is not online. rockshe1000
Joined: 26 May 2011
Total Posts: 547
10 Jul 2014 01:10 PM
Smiley me and team are brothers, he and I are working on dbz games, (seperate of course)
and from the help of smiley, on the other thread he halped me on, uhh I think it was him XD

heres my code I use, atleast I do now XD
Data=game:GetService("DataStoreService"):GetDataStore("Stats")--change points to whatever
local stats = {"Ki", "Physical", "Agility"}

game.Players.PlayerAdded:connect(function(player)
local leaderstats = Instance.new("Model", player)
leaderstats.Name = "leaderstats"
for _, stat in pairs(stats) do
a=Instance.new("IntValue", leaderstats)
a.Name = stat
a.Value=Data:GetAsync(player.userId..stat)
a.Changed:connect(function(value)
Data:SetAsync(player.userId..stat,value)
end)
end
end)
Report Abuse
TeamZeplin is not online. TeamZeplin
Joined: 09 Jul 2011
Total Posts: 76
10 Jul 2014 01:11 PM
Well i'm making those for my dbz game. but soon as i get those working and the gui etc i might be adding a few other stats.
Report Abuse
smiley599 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
10 Jul 2014 01:12 PM
it was me ye
i see
well ye that^
Report Abuse
TeamZeplin is not online. TeamZeplin
Joined: 09 Jul 2011
Total Posts: 76
10 Jul 2014 01:16 PM
Rock i put the code in my leaderstats script in workspace and it did not work lol.
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