DeGames
|
  |
| Joined: 08 Sep 2012 |
| Total Posts: 1028 |
|
|
| 23 Jan 2016 11:03 AM |
| Of a script that will damage one "Player" and not "Player2" |
|
|
| Report Abuse |
|
|
|
| 23 Jan 2016 11:06 AM |
game.Players["Player"].Character.Humanoid.Health = 90
i make u math.sqrt() |
|
|
| Report Abuse |
|
|
Aethex
|
  |
| Joined: 16 Oct 2011 |
| Total Posts: 2193 |
|
|
| 23 Jan 2016 11:09 AM |
@IllegallyBlind that doesn't damage anyone, that just sets their health to 90
if "Player" has less than 90 health, you're healing them
he needs to do:
game.Players["Player"].Character.Humanoid:TakeDamage(10) if using your code setup |
|
|
| Report Abuse |
|
|
|
| 23 Jan 2016 11:10 AM |
@above
I understand that, I'm just too lazy to write out that entire boring line. :^)
i make u math.sqrt() |
|
|
| Report Abuse |
|
|
Aethex
|
  |
| Joined: 16 Oct 2011 |
| Total Posts: 2193 |
|
|
| 23 Jan 2016 11:11 AM |
| he really should be waiting for the character, though, when using your setup |
|
|
| Report Abuse |
|
|
|
| 23 Jan 2016 11:28 AM |
HP = game.Players["Player"].Character.Humanoid.Health MinHP = 0
if HP > MinHP then wait(.5) HP = HP - 2 end
^ Try that. You can set the MinHP variable to the minimum HP you want them left with if you don't want to kill them, otherwise leave it at 0 to kill them. |
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Jan 2016 11:30 AM |
"HP = HP - 2" HP is not a pointer to Health though. HP is its own value, not linked to Health. |
|
|
| Report Abuse |
|
|
|
| 23 Jan 2016 11:36 AM |
Then would,
game.Players["Player"].Character.Humanoid.Health = HP
make HP the players health value?
If so then this should work,
game.Players["Player"].Character.Humanoid.Health = HP MinHP = 0 -- AKA Dead
while HP > MinHP do wait(.5) HP = HP - 2 end |
|
|
| Report Abuse |
|
|
|
| 23 Jan 2016 11:41 AM |
No, that's sort of worse since HP is nil.
H = game.Players["Player"].Character.Humanoid MinHP = 0 -- AKA Dead
while H.Health > MinHP do wait(.5) H.Health = H.Health - 2 end |
|
|
| Report Abuse |
|
|