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: Attempt to index field

Previous Thread :: Next Thread 
Glixtr is online. Glixtr
Joined: 03 Jul 2011
Total Posts: 174
20 May 2016 06:23 AM
local Player = game.Players.LocalPlayer
local Avatar = Player.Character
local Humanoid = Avatar:WaitForChild("Humanoid")
local cam = game.Workspace.CurrentCamera

Humanoid.Health.Changed:connect(function()
if (Humanoid.Health <= 25) and (Humanoid.Health >= 20) then
print("Low health!")
end
end)



Local script
The output says this: "Workspace.Player1.HealthEffects:6: attempt to index field 'Health' (a number value)"

I can tell it's an error, and I don't know how to fix it.


Report Abuse
xshot23 is not online. xshot23
Joined: 17 Oct 2014
Total Posts: 4873
20 May 2016 06:56 AM
Humanoid.health.changed is ur problem
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
20 May 2016 07:28 AM
Humanoid.HealthChanged:connect(function()


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