Scripts for a game.
#7
(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
[Image: Animated.gif?t=1314294800]
Reply


Messages In This Thread
Scripts for a game. - by Sazaho - 08-04-2011, 08:03 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)