This is what I have, and I think that my problem is with line 2 ( if Health == 0>30 then )
1 | local Health = script.Parent.Parent.Parent.Parent.Character.humanoid.Health |
2 | if Health = = 0 > 30 then |
3 |
4 | script.Parent.Parent.Parent.Parent.Character.humanoid.Health = "100" |
5 | script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new( 99.23 , 149.962 , - 2.248 ) |
6 |
7 |
8 |
9 | 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?
01 | function MouseClick() |
02 | wait( 0 ) |
03 | local numplaying = Game.Workspace.Game 1. Players.Value; |
04 | if numplaying = = 0 or numplaying = = 1 then |
05 |
06 |
07 | script.Parent.Parent.Parent.Parent.Character.Torso.CFrame = CFrame.new( 19.6 , 4.6 , - 27.6 ) |
08 | wait( 0 ) |
09 | numplaying = (numplaying+ 1 ) |
10 |
11 |
12 |
13 | end |
14 | end |
15 |
Well, I see a couple of errors in the first two
lines,
1 | 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
1 | 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.