Posts: 1,926
Threads: 133
Joined: Apr 2011
Reputation:
0
1.) I don't know how to make it so that the script together with the UI will go into the PlayerUI once it enters the game.
2.) Once the player dies, the health bar will stay red. I need it so that it will run again once the player respawns.
Posts: 1,089
Threads: 52
Joined: Apr 2011
Reputation:
0
Make it trace the players health, here's a bit of code to help you:
[lua]
--Code above
if player.Health >= 25 then --Assuming you already have the player sorted out
HealthBar.Color = Color(205,25,88) --Assuming the healthbar is one piece.
else
HealthBar.Color = Color(62,190,116)
--Code below
[/lua]
Posts: 1,926
Threads: 133
Joined: Apr 2011
Reputation:
0
No... I don't need changing colors. I already have coded it into the script so that it tooltips the player's current health.
Posts: 1,586
Threads: 85
Joined: Apr 2011
Reputation:
0
I could give you it in roblox lua, but I can't be bothered to translate.
Assuming the script is in the UI:
[lua]-- Put UI in game.Storage
game.Storage.UI = a
Muffinz(Player)
a.Parent = Player.UI
a.script.Enabled = true (THis will activate the script below)
end
game.Players.PlayerAdded:connect(Muffinz)
[/lua]
As for the resetting, put another script in the UI with this in it :
[lua] while script.Parent.Parent.Parent.Name == Players do
wait (0.1)
if script.Parent.Parent.Character.Health > 1 then
--Reset Gui
end
end
[/lua]