|
| 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
|
  |
| 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 |
|
|
| |
|
| |
|