|
| 14 Oct 2015 02:19 PM |
whats wrong with this script? function script.Parent.Touched:connect(hit) if hit.Parent.findFirstChild("Humanoid") then hit.Parent.Humanoid.Health = 0 end end |
|
|
| Report Abuse |
|
|
iara56
|
  |
| Joined: 23 Nov 2012 |
| Total Posts: 1032 |
|
|
| 14 Oct 2015 02:20 PM |
script.Parent.Touched:connect(function(hit) if hit.Parent.findFirstChild("Humanoid") then hit.Parent.Humanoid.Health = 0 end end |
|
|
| Report Abuse |
|
|
|
| 14 Oct 2015 02:24 PM |
whats it for
ill try to make you a new script |
|
|
| Report Abuse |
|
|
|
| 14 Oct 2015 02:30 PM |
function script.Parent.Touched:connect(hit) if hit.Parent.FindFirstChild("Humanoid") then --Case fail. Its not findFirstChil.. hit.Parent.Humanoid.Health = 0 end end
- "I say no because yes is overrated" |
|
|
| Report Abuse |
|
|
|
| 14 Oct 2015 02:30 PM |
wait nvm i fixed it
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild('Humanoid') then hit.Parent.Humanoid.Health = 0 end end) |
|
|
| Report Abuse |
|
|
|
| 14 Oct 2015 02:34 PM |
Yeah, i forgot the;
end)
- "I say no because yes is overrated" |
|
|
| Report Abuse |
|
|
|
| 14 Oct 2015 02:34 PM |
| And you misplaced function |
|
|
| Report Abuse |
|
|
|
| 14 Oct 2015 02:39 PM |
lol, how tf did i not notice that........ Here is the correct one:
script.Parent.Touched:connect(function(hit) if hit.Parent.FindFirstChild("Humanoid") then hit.Parent.Humanoid.Health = 0 end end)
-- Error1; Case on FindFirstChild --Error2; Misplaced function --Error3; end, instead of anonymous 'end)'
- "I say no because yes is overrated" |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 14 Oct 2015 02:57 PM |
there's a lot of stupidity here
script.Parent.Touched:connect(function(hit) if hit.Parent:findFirstChild("Humanoid") then hit.Parent.Humanoid.Health = 0 end end)
Red Blossoms |
|
|
| Report Abuse |
|
|
|
| 14 Oct 2015 02:59 PM |
What? Fite me.
- "I say no because yes is overrated" |
|
|
| Report Abuse |
|
|
|
| 14 Oct 2015 03:04 PM |
Faisal, FindFirstChild is a method, and methods are called using : and not . Properties are accessed using "." |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 14 Oct 2015 03:14 PM |
findFirstChild is also a legal method
Red Blossoms |
|
|
| Report Abuse |
|
|
|
| 14 Oct 2015 03:16 PM |
I know it's:, and not ., I'm tired, cut me a slack ;( @rayk And, that i legally didn't know. Pun not intended.
- "I say no because yes is overrated" |
|
|
| Report Abuse |
|
|