08-11-2011, 10:39 AM
(08-04-2011, 09:39 PM)Qwertygiy Wrote: Here's a global healing script for you -- change the waittime and percentage values as wanted and place it in World.
[lua]
local waittime = 2 --How long between heals
local percentage = 2.5 --How much to heal
while true do --Constant!
sleep(waittime)
local players = game.Players:getChildren()
for q = 1, #players do
if players[q]:isA("Player") and players[q].Character and players[q].Character.Health > 0 then
--Making sure you're there
if players[q].Character.Health < players[q].Character.MaximumHealth then
if players[q].Character.Health <= (players[q].Character.MaximumHealth - (players[q].Character.MaximumHealth * percentage * 1/100)) then
players[q].Character.Health = players[q].Character.Health + (players[q].Character.MaximumHealth * percentage * 1/100)
else
players[q].Character.Health = players[q].Character.MaximumHealth
end end end end end
[/lua]
Thanks again, Qwertygiy
Shiggity Shiggity Shwa