generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Where can I find Humanoid at?

Previous Thread :: Next Thread 
crossbar is not online. 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 is not online. 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
konichiwah91 is not online. konichiwah91
Joined: 18 Jan 2011
Total Posts: 3677
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 is not online. 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 is not online. crossbar
Joined: 08 Dec 2009
Total Posts: 2817
04 Jan 2014 05:09 PM
Thanks. :)
Report Abuse
crossbar is not online. 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 is not online. 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
david1234501 is not online. david1234501
Joined: 04 Oct 2008
Total Posts: 737
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 is not online. 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
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
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
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
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
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image