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: How To Update Game Players' Health Every X Seconds?

Previous Thread :: Next Thread 
milkydadup is not online. milkydadup
Joined: 31 Jan 2014
Total Posts: 58
09 Oct 2016 04:16 PM
Each player in my game has a hidden leadstats and a health value as a child of the leaderstats.

How can I retrieve the current health of every player in the game and then update their current health values of their hidden leaderstats?

Report Abuse
Stiiky is not online. Stiiky
Joined: 15 Jan 2010
Total Posts: 451
09 Oct 2016 04:25 PM
while true do
wait(timehere) -- change time here with the amount you want to wait IN SECONDS
for i,v in pairs(game.Workspace.Players:GetChildren()) do
game.Lighting.FakeHealth.Value = game.Workspace[v.Name].Humanoid.Health
end
end

There you go.


Report Abuse
milkydadup is not online. milkydadup
Joined: 31 Jan 2014
Total Posts: 58
09 Oct 2016 04:40 PM
Thanks for the function. I'll try to get this working with my game.
Report Abuse
Stiiky is not online. Stiiky
Joined: 15 Jan 2010
Total Posts: 451
09 Oct 2016 04:53 PM
No problem.


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