|
| 15 Jul 2011 11:56 AM |
function onTouch(hit) if hit.Parent IsInGroup(159511) then script.Parent.CanCollide = false wait(2) script.Parent.CanCollide = true end end script.Parent.Touched:connect(onTouch)
it is a group door, but it doesn't work.
The output says : 'then' expected near 'IsInGroup'
what is wrong with it? |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2011 11:57 AM |
"if hit.Parent IsInGroup(159511) then"
Firstly, it would be hit.Parent:IsInGroup(159511)
Secondly, you dont know if hit.Parent is not nil, and you dont know if its a character.
Thirdly, IsInGroup() method is only used on the Player object, not the Model object. |
|
|
| Report Abuse |
|
|
|
| 15 Jul 2011 12:00 PM |
function onTouch(hit) plr = game.Players:findFirstChild(hit.Parent.Name) if plr then if plr:IsInGroup(159511) then script.Parent.CanCollide = false wait(2) script.Parent.CanCollide = true end end end script.Parent.Touched:connect(onTouch)
|
|
|
| Report Abuse |
|
|
|
| 15 Jul 2011 12:01 PM |
function onTouch(hit) if hit.Parent~=nil then plr = game.Players:findFirstChild(hit.Parent.Name) if plr then if plr:IsInGroup(159511) then script.Parent.CanCollide = false wait(2) script.Parent.CanCollide = true end end end end script.Parent.Touched:connect(onTouch)
|
|
|
| Report Abuse |
|
|