|
| 17 Aug 2013 05:09 AM |
Workspace.Model.Script:5: attempt to index field 'Parent' (a nil value) Line Five: if hit.Parent:FindFirstChild("Humanoid") ~= nil then |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2013 05:10 AM |
| It means its non-existent. Meaning you are tagging it wrong. |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2013 05:12 AM |
| I am not tagging it wrong, It works 90% of the time. I connected .Touched to a function touched(hit)... |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2013 05:13 AM |
| In order for it to run that script and get the error the part would have to be hit by something and that something must have a parent. |
|
|
| Report Abuse |
|
|
Cakins
|
  |
| Joined: 23 Jul 2009 |
| Total Posts: 307 |
|
|
| 17 Aug 2013 05:15 AM |
Here is a plausible scenario.
Object 1 hits object 2. Object 2 or the parent of object 2 is removed. Script checks for parent of object 2. |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2013 05:17 AM |
| Oh no cakins, thats impossible bruh, could never happen, parent is so not non0existent bruh, could nevrr be true bruh, imosibruuu!!! |
|
|
| Report Abuse |
|
|
Cakins
|
  |
| Joined: 23 Jul 2009 |
| Total Posts: 307 |
|
|
| 17 Aug 2013 05:20 AM |
| U rite. Mah bad. Disregurd. /cry |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2013 05:21 AM |
| Its k, youlllllll LEARN. br0 |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2013 06:58 AM |
| game doesn't have a parent. Check out this basic script. game. Workspace.RandomBrick.Transparency = 1. Is there anything before game? No. |
|
|
| Report Abuse |
|
|
08C
|
  |
| Joined: 26 Jan 2013 |
| Total Posts: 847 |
|
| |
|
|
| 17 Aug 2013 09:38 AM |
You are going to have to ask what u hit, before "Up Valuing" hits Parent, because Sky doesn't have a Parent (Or some other Part u hit all the time with mouse....)?
Check what Target equals as well, Print-out all of the possible senerios, then take appropriate actions....
|
|
|
| Report Abuse |
|
|
|
| 17 Aug 2013 09:43 AM |
You should not use pcall in this case, because you do not need to use pcall. The only place to use pcall in Roblox is when writing a script builder script or any form of server communication (marketplaceservice, teleportservice, data persistence, etc).
@OP When trying to get help, please post the entire script. My guess is you did not check to see if hit.Parent ~= nil in your script. |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2013 09:57 AM |
Only problem is that this will give him the same error:
if hit.Parent ~= nil in your script
You r going to have to ask a few questions about hit, first.
|
|
|
| Report Abuse |
|
|
|
| 17 Aug 2013 09:58 AM |
| That won't give him an error. o_O |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2013 10:06 AM |
Yeah,
I see that laser gun does the same thing:
local humanoid = hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid")
I had no idea. Makes things a lot easier. |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2013 10:14 AM |
"hit and "
That part isn't even needed because 'hit' will always exist in a touched script where the parameter is named 'hit'. |
|
|
| Report Abuse |
|
|