vastqud
|
  |
| Joined: 10 Sep 2011 |
| Total Posts: 2464 |
|
|
| 07 Aug 2015 03:53 PM |
local player = game.Players.LocalPlayer
local char = player.Character; if not char then player.CharacterAdded:wait() char = player.Character end
local velocity = char.Torso.Velocity
if velocity.Y < -15 then char.Humanoid.Health = char.Humanoid.Health - 15 end
the error is that it says "Attempt to index local "player" a nil value" once I get past that error, would it still work? |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2015 04:11 PM |
That whole thing would only run once. It does seem like it should work.
Also, you can do
local char = player.Character or player.CharacterAdded:wait() |
|
|
| Report Abuse |
|
|
vastqud
|
  |
| Joined: 10 Sep 2011 |
| Total Posts: 2464 |
|
|
| 07 Aug 2015 05:22 PM |
| what do u mean it would only run once? |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2015 05:38 PM |
"local velocity = char.Torso.Velocity
if velocity.Y < -15 then char.Humanoid.Health = char.Humanoid.Health - 15 end"
That isn't going to keep repeating [I'm assuming you want to check that the torso is always that condition] |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 07 Aug 2015 06:07 PM |
repeat wait() until player.Character
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
| Report Abuse |
|
|