I plan to make a Gui that Appears when a player's health is below 20, if it is over 20 the Gui will not popup
FYI: NO ERROR POPPED UP
Here is my Code:
local s=Instance.new("Sound")--created a Sound
if game.Players.LocalPlayer.Character.Humanoid.Health<=20 then
s.SoundId="http://www.roblox.com/asset/?id=149532107"
s.Parent=workspace
s.Looped=true
script.Parent.Visible=true--the script.Parent is the Frame
else
if game.Players.LocalPlayer.Character.Humanoid.Health>=20 then
script.Parent.Visible=false
s.Parent=workspace
s:stop()
end
end
while true do
script.Parent.BackgroundTransparency=0.2
wait(0.1)
script.Parent.BackgroundTransparency=0.1
wait(0.1)
script.Parent.BackgroundTransparency=0
wait(0.1)
script.Parent.BackgroundTransparency=0.1
wait(0.1)
script.Parent.BackgroundTransparency=0.2
wait(0.1)
script.Parent.BackgroundTransparency=0.3
wait(0.1)
end
*Please Reply back I would appreciate it! *

4 comments
Why are you using "Changed" instead of "HealthChange"?
and you forgot an "end)"
works thx
I was going to use Changed, but read up on HealthChanged and forgot to change my code to reflect that. As far as I am aware, there is no missing
end, just a missing closing parenthesis.