stipess
|
  |
| Joined: 11 May 2011 |
| Total Posts: 2018 |
|
|
| 15 Jul 2013 07:53 PM |
So this script just doesn't work, it's in a part, and it's a local script
-- Made completely by stipess
Allowed = playername -- Put the names of people you want to be able to pass
function Ontouch(player) script.Parent.FindFirstChild(Humanoid) if Humanoid and player.Name == Allowed then script.Parent.CanCollide = false script.Parent.Transparency = 0.4 wait(2) script.Parent.CanCollide = true script.Parent.Transparency = 0 end end script.Parent.Touched:connect(Ontouch) |
|
|
| Report Abuse |
|
|
DrWaffler
|
  |
| Joined: 16 Sep 2011 |
| Total Posts: 4248 |
|
|
| 15 Jul 2013 07:54 PM |
The problem is that it is in a local script, put it in a regular script, and run it.
Love me? Find me on Twitter! @DrWafflerRBLX |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2013 07:55 PM |
| Should be script.Parent:FindFirstChild("Humanoid") findFirstChild is used with the name of the part you're trying to find. |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2013 07:56 PM |
"Allowed = playername -- Put the names of people you want to be able to pass"
Maybe its the fact that playername isn't a string.
Second, it's :FindFirstChild, not .FindFirstChild (It's a : not a .) Third, Humanoid isn't defined Fourth FindFirstChild need a string, not an instance, which in this case is nil. |
|
|
| Report Abuse |
|
|
stipess
|
  |
| Joined: 11 May 2011 |
| Total Posts: 2018 |
|
|
| 15 Jul 2013 07:58 PM |
| How do you mean Humanoid isn't defined? |
|
|
| Report Abuse |
|
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|
|
| 15 Jul 2013 07:59 PM |
Allowed = "playername" -- You need " "around the name
function Ontouch(player) script.Parent.FindFirstChild("Humanoid") -- You need "" around humanoid if Humanoid and player.Name == Allowed then script.Parent.CanCollide = false script.Parent.Transparency = 0.4 wait(2) script.Parent.CanCollide = true script.Parent.Transparency = 0 end end script.Parent.Touched:connect(Ontouch) |
|
|
| Report Abuse |
|
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|
|
| 15 Jul 2013 08:02 PM |
"How do you mean Humanoid isn't defined?" Humanoid isn't defined.
>18cwat >findFirstChild***
No, it can be either FindFirstChild or findFirstChild, but their not making camelCase methods anymore.
"Humanoid isnt find because of your mistake before it the findFirstChild one" What he needs to do is this;
Humanoid = script.Parent:FindFirstChild("Humanoid")
|
|
|
| Report Abuse |
|
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|