crossbar
|
  |
| Joined: 08 Dec 2009 |
| Total Posts: 2817 |
|
|
| 04 Jan 2014 05:04 PM |
game.Humanoid.Health does not seem to work
If you could tell me that would great thanks. |
|
|
| Report Abuse |
|
|
DataStore
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 8540 |
|
|
| 04 Jan 2014 05:06 PM |
game.Players.LocalPlayer.Character.Humanoid --// LocalScript Workspace["Name Here"].Humanoid game.Players["Name Here"].Character.Humanoid game.Players:FindFirstChild("Name Here").Character
Basically, you'll find it in the player's character (as I'm assuming that you're looking for a player's Humanoid). |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2014 05:07 PM |
game.Workspace.Model.Humanoid.Health
Humanoid is a basic object inserted into a model to make a human. The model needs a Head for this to work.
|
|
|
| Report Abuse |
|
|
crossbar
|
  |
| Joined: 08 Dec 2009 |
| Total Posts: 2817 |
|
|
| 04 Jan 2014 05:08 PM |
| I'm not writing with localscript however. And what do you mean by "name here"? |
|
|
| Report Abuse |
|
|
crossbar
|
  |
| Joined: 08 Dec 2009 |
| Total Posts: 2817 |
|
| |
|
crossbar
|
  |
| Joined: 08 Dec 2009 |
| Total Posts: 2817 |
|
|
| 04 Jan 2014 05:13 PM |
| It says "Model is not a valid member of Workspace. xD |
|
|
| Report Abuse |
|
|
DataStore
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 8540 |
|
|
| 04 Jan 2014 07:41 PM |
@Cross... We can't put it across any simpler.
If you want the player's Humanoid, parent up to their player OBJECT, in the players service. Then use the Character property of the player, and then "reach out to your Humanoid" (Player.Character.Humanoid <<-- NOTE PLAYER WOULD NEED TO BE DEFINED).
Koni was putting across where a Humanoid would normally be. He/she didn't mean for you to just slap it into a script and hope for the best.
|
|
|
| Report Abuse |
|
|
|
| 04 Jan 2014 07:44 PM |
game.Workspace.PLAYERNAMEHERE.Humanoid.Health = 0
NOTE: This only works for one specific player, if you are trying to make a lava script or something, it will only kill the player with their name in the directory. |
|
|
| Report Abuse |
|
|
crossbar
|
  |
| Joined: 08 Dec 2009 |
| Total Posts: 2817 |
|
|
| 04 Jan 2014 07:56 PM |
| Yeah, but I need it not for a specific person. I need it for humanoids in general. |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2014 07:59 PM |
function OnTouched(hit) h = hit.Parent:findFirstChild("Humanoid")-- check if its a human if h~=nil then--if the thing that touched it is a person then.. h.Health = h.Health - 5-- can change this,sets the health relative to -5 end end script.Parent.Touched:connect(OnTouched)--make sure u put the script into the --block |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2014 08:00 PM |
my script will bring down a players health by five if they hit the block u put the script into so itd look like this:
-Workspace -Brick - Script |
|
|
| Report Abuse |
|
|
|
| 04 Jan 2014 08:00 PM |
oh and this kills everyone:
p = game.Players:GetChildren() for i = 1,#p do p[i].Character.Head:remove() end |
|
|
| Report Abuse |
|
|
crossbar
|
  |
| Joined: 08 Dec 2009 |
| Total Posts: 2817 |
|
|
| 05 Jan 2014 09:08 AM |
| Thanks, my script is essentially like yours but I didn't have the correct hierarchy for Humanoid. :) |
|
|
| Report Abuse |
|
|