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 » Scripters
Home Search
 

Re: humanoid not found even after character model loaded

Previous Thread :: Next Thread 
Rocketgamer10 is not online. Rocketgamer10
Joined: 21 Jan 2009
Total Posts: 4347
14 Jan 2015 09:53 PM
local Player = game.Players.LocalPlayer
local Character = Player.Character
if not Character or Character.Parent == nil then
Character = Player.CharacterAdded:wait()
end
local Humanoid = Character.Humanoid

first 5 lines from wiki

line 6 only works in studio test mode, not online; says humanoid is not a valid member. is it something to do with the humanoid not being loaded into the character before the line is run?
Report Abuse
DoAndDoOver is not online. DoAndDoOver
Joined: 06 Sep 2014
Total Posts: 628
14 Jan 2015 09:54 PM
local player = game.Players.LocalPlayer
local character = player.Character or player:WaitForChild("Character")
local humanoid = character.Humanoid
Report Abuse
Rocketgamer10 is not online. Rocketgamer10
Joined: 21 Jan 2009
Total Posts: 4347
14 Jan 2015 10:00 PM
no error but no work
Report Abuse
Rocketgamer10 is not online. Rocketgamer10
Joined: 21 Jan 2009
Total Posts: 4347
14 Jan 2015 10:03 PM
pretty sure it's stuck on second line
Report Abuse
DoAndDoOver is not online. DoAndDoOver
Joined: 06 Sep 2014
Total Posts: 628
14 Jan 2015 10:04 PM
is it in a localscript?

is it in the startergui?

if you answered yes, then yes it does work
Report Abuse
verbalAKspray is not online. verbalAKspray
Joined: 09 Jul 2014
Total Posts: 23685
14 Jan 2015 10:04 PM
:waitforchild on the humanoid then
Report Abuse
Rocketgamer10 is not online. Rocketgamer10
Joined: 21 Jan 2009
Total Posts: 4347
14 Jan 2015 10:04 PM
fixed it, just changed my original line 6 to:

local Humanoid = Character:WaitForChild("Humanoid")
Report Abuse
Rocketgamer10 is not online. Rocketgamer10
Joined: 21 Jan 2009
Total Posts: 4347
14 Jan 2015 10:05 PM
and yes it was in starter gui in a local script
Report Abuse
DoAndDoOver is not online. DoAndDoOver
Joined: 06 Sep 2014
Total Posts: 628
14 Jan 2015 10:05 PM
if your script doesn't work, it is because the rest of your script is whack.

here's a simple test code to put in a localscript, in the startergui

local player = game.Players.LocalPlayer
local character = player.Character or player:WaitForChild("Character")
local humanoid = character.Humanoid
print(tostring(humanoid.Health))

--it will print 100 because it gets your player, then your character, then your humanoid, and then prints your health
Report Abuse
Rocketgamer10 is not online. Rocketgamer10
Joined: 21 Jan 2009
Total Posts: 4347
14 Jan 2015 10:07 PM
the rest of my script was print("test"), and didn't see "test" in output
Report Abuse
Rocketgamer10 is not online. Rocketgamer10
Joined: 21 Jan 2009
Total Posts: 4347
14 Jan 2015 10:08 PM
btw not testing in studio mode, testing online
Report Abuse
DoAndDoOver is not online. DoAndDoOver
Joined: 06 Sep 2014
Total Posts: 628
14 Jan 2015 10:09 PM
local player = game.Players.LocalPlayer
local character = player.Character or player:WaitForChild("Character")
local humanoid = character.Humanoid

if this is your script^^^^^^^^

and then you just say

print("test")

it will work
Report Abuse
Rocketgamer10 is not online. Rocketgamer10
Joined: 21 Jan 2009
Total Posts: 4347
14 Jan 2015 10:10 PM
yes, it works in studio test mode, but to clarify again, i am testing on a server
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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