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: how do i fix this?

Previous Thread :: Next Thread 
monkeysmouth is not online. monkeysmouth
Joined: 10 Feb 2011
Total Posts: 493
08 Mar 2012 10:33 AM
well im a really beginner scripter and i was trying to make a tycoon. so i went on wiki and found out how to make one then copied the script(s) to my place, but when i ran it i got an error message saying "humanoid is not a valid member of hat" even though it says HIT not HAT help meeeeeeeee! please?

function onTouched(hit)
if hit.Parent.Humanoid~= nil then -- <----- right here.
cash = game.Players:findFirstChild(hit.Parent.Name).leaderstats.Cash -- Find out who touched.
if cash.Value >= 100 then
cash.Value = cash.Value- 100
end
end
end
script.Parent.Touched:connect(onTouched)
Report Abuse
MXrcr20 is not online. MXrcr20
Joined: 01 Oct 2008
Total Posts: 2644
08 Mar 2012 10:44 AM
"if hit.Parent.Humanoid~= nil then"

Use this instead:

if hit.Parent:findFirstChild("Humanoid") ~= nil then
Report Abuse
monkeysmouth is not online. monkeysmouth
Joined: 10 Feb 2011
Total Posts: 493
08 Mar 2012 10:53 AM
ok ill try it
Report Abuse
monkeysmouth is not online. monkeysmouth
Joined: 10 Feb 2011
Total Posts: 493
08 Mar 2012 10:56 AM
hey it worked l:D thanks.
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