|
| 19 Dec 2014 07:45 PM |
I made a script that is supposed to open a door when someone touches it if they're on a specific team. I matched the requirements and I tested it but it didn't work. Here's the script.
door = script.Parent door.Touched:connect(function(toucher) toucher.Parent.Humanoid:GetPlayerFromCharacter(_G.plyr) if _G.plyr.TeamColor == game.Teams.Hostiles.TeamColor then door.Transparency = 0.5 door.CanCollide = false wait(3) door.Transparency = 0 door.CanCollide = true end end)
The only thing that the server-side output said was that Touched is not a valid member of Model. How can I fix this?
A true rock is not a rock silly goose. |
|
|
| Report Abuse |
|
|
SMS1337
|
  |
| Joined: 19 Feb 2014 |
| Total Posts: 10504 |
|
|
| 19 Dec 2014 07:47 PM |
put the script in the part, not the model
"Eat greens everyday!" - Snoop Catt |
|
|
| Report Abuse |
|
|
|
| 20 Dec 2014 07:39 AM |
It is in the part.
A true rock is not a rock silly goose. |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2014 12:13 PM |
b1
A true rock is not a rock silly goose. |
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 23 Dec 2014 12:16 PM |
no idea why you're using a _G variable at all
your parameter is the "toucher" or the thing that touched the brick and fired the event. If this is a body part, then it's parent will be a character, and you check for that by making sure it has a humanoid.
Then, you use hit.Parent in your :GetPlayerFromCharacter (), as hit.Parent is a character |
|
|
| Report Abuse |
|
|
maxomega3
|
  |
| Joined: 11 Jun 2010 |
| Total Posts: 10668 |
|
|
| 23 Dec 2014 12:17 PM |
oh, I see the confusion.
You can only call :GetPlayerFromCharacter () on game.Players
local plyr = game.Players:GetPlayerFromCharacter (hit.Parent) |
|
|
| Report Abuse |
|
|
|
| 24 Dec 2014 12:49 PM |
implementing
A true rock is not a rock silly goose. |
|
|
| Report Abuse |
|
|
|
| 24 Dec 2014 12:53 PM |
subsection title hereby described U.S. subtitle killing
A true rock is not a rock silly goose. |
|
|
| Report Abuse |
|
|