This is what I have, and I think that my problem is with line 2 ( if Health == 0>30 then )
local Health = script.Parent.Parent.Parent.Parent.Character.humanoid.Health if Health == 0>30 then script.Parent.Parent.Parent.Parent.Character.humanoid.Health= "100" script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(99.23, 149.962, -2.248) end
D:
Its still not working! This is the whole script! its in a GUI button.
Line 9 is't working eather! can someone give me a fix?
function MouseClick() wait(0) local numplaying = Game.Workspace.Game1.Players.Value; if numplaying == 0 or numplaying == 1 then script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(19.6, 4.6, -27.6) wait(0) numplaying = (numplaying+1) end end script.Parent.MouseButton1Down:connect(MouseClick) local Health = script.Parent.Parent.Parent.Parent.Character.Humanoid.Health if Health <=30 then script.Parent.Parent.Parent.Parent.Character.Humanoid.Health= "100" script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new(99.23, 149.962, -2.248) end
Well, I see a couple of errors in the first two
lines,
local health = script.Parent.Parent.Parent.Parent.Character.Humanoid.Health
You need to capitalize the H in Humanoid, in Lua, capitalization matters.
Also, 0>30
is basically saying if 0
is greater than 30
(which it is not), then..
and thats why your script bellow Line 2 does not work, also remember to capitalize the H in humanoid on line 4 too.
So instead of 0>30, use
if Health <=30 then
<=
is saying "less than or equal too 30" in Lua, as if you did >=
that would mean "greater than or equal too.