352ynnhoj
|
  |
| Joined: 21 Sep 2010 |
| Total Posts: 1054 |
|
|
| 22 Dec 2011 05:51 PM |
Here is the script I am stuck on: function start() local Torso = script.Parent.Parent.Character.Torso.Position if Torso.Y > 10 then local health = script.Parent.Parent.Character.Humanoid.Health local warning = script.Parent.AltitudeSickness.Frame.Visible health = health - 10 warning = true wait(3) if Torso.Y < 10 then warning = false end end end
while true do wait() if script.Parent.Parent.Character.Humanoid ~= nil then start() end end
I am trying to get it where when the torso reaches a sertain point on Vector3.Y it will cause health loss... Altitude Sickness! |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2011 05:54 PM |
if Torso.Y >= 10 then local health = script.Parent.Parent.Character.Humanoid.Health local warning = script.Parent.AltitudeSickness.Frame.Visible health = health - 10 warning = true wait(3) if Torso.Y =< 10 then warning = false end end end
What Pumpkin? |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2011 05:55 PM |
| What exactly is wrong with it..? |
|
|
| Report Abuse |
|
|
352ynnhoj
|
  |
| Joined: 21 Sep 2010 |
| Total Posts: 1054 |
|
|
| 22 Dec 2011 05:57 PM |
| error on line 9. = expected near then... Do i flip the < and the =? |
|
|
| Report Abuse |
|
|
| |
|
352ynnhoj
|
  |
| Joined: 21 Sep 2010 |
| Total Posts: 1054 |
|
| |
|
352ynnhoj
|
  |
| Joined: 21 Sep 2010 |
| Total Posts: 1054 |
|
|
| 22 Dec 2011 06:08 PM |
| Tried that and it didnt work but gave no error |
|
|
| Report Abuse |
|
|
352ynnhoj
|
  |
| Joined: 21 Sep 2010 |
| Total Posts: 1054 |
|
|
| 22 Dec 2011 06:09 PM |
Again here is what I have:
health = script.Parent.Parent.Character.Humanoid.Health warning = script.Parent.AltitudeSickness.Frame.Visible Torso = script.Parent.Parent.Character.Torso.Position
function start() if Torso.Y >= 10 then health = health - 10 warning = true wait(3) if Torso.Y <= 10 then warning = false end end end
while true do wait() if script.Parent.Parent.Character.Humanoid ~= nil then start() end end |
|
|
| Report Abuse |
|
|
352ynnhoj
|
  |
| Joined: 21 Sep 2010 |
| Total Posts: 1054 |
|
| |
|
352ynnhoj
|
  |
| Joined: 21 Sep 2010 |
| Total Posts: 1054 |
|
|
| 22 Dec 2011 06:26 PM |
| still stuck on this script |
|
|
| Report Abuse |
|
|
352ynnhoj
|
  |
| Joined: 21 Sep 2010 |
| Total Posts: 1054 |
|
| |
|
352ynnhoj
|
  |
| Joined: 21 Sep 2010 |
| Total Posts: 1054 |
|
|
| 22 Dec 2011 06:42 PM |
fixed a few things but its still not working and gives no errors:
health = script.Parent.Parent.Character.Humanoid.Health warning = script.Parent.AltitudeSickness.Frame.Visible Torso = script.Parent.Parent.Character.Torso.Position
function start() if Torso.Y > 10 then health = health - 10 warning = true wait(3) else warning = false end end
while true do wait() if script.Parent.Parent.Character.Humanoid ~= nil then start() end end
Its suppost to find the value of the Axis y on the torso position but it wont find it... |
|
|
| Report Abuse |
|
|
352ynnhoj
|
  |
| Joined: 21 Sep 2010 |
| Total Posts: 1054 |
|
| |
|
352ynnhoj
|
  |
| Joined: 21 Sep 2010 |
| Total Posts: 1054 |
|
| |
|
1pie23
|
  |
| Joined: 11 Jul 2010 |
| Total Posts: 1865 |
|
|
| 22 Dec 2011 07:33 PM |
omg it deleted my comment! 1 sec i'll post it again it works trust me |
|
|
| Report Abuse |
|
|
1pie23
|
  |
| Joined: 11 Jul 2010 |
| Total Posts: 1865 |
|
|
| 22 Dec 2011 07:34 PM |
function start() if Torso.Y > 10 then health = health - 10 warning = true wait(3) elseif Torso.Y <= 10 then warning = false end end
while true do wait() if script.Parent.Parent.Character.Humanoid ~= nil then start() end end
|
|
|
| Report Abuse |
|
|
1pie23
|
  |
| Joined: 11 Jul 2010 |
| Total Posts: 1865 |
|
|
| 22 Dec 2011 07:35 PM |
| I forgot to add your variables, but you get my point |
|
|
| Report Abuse |
|
|