jackb1014
|
  |
| Joined: 13 May 2012 |
| Total Posts: 20 |
|
|
| 30 Oct 2012 04:51 PM |
function onTouched(hit) if Game:GetService("GamePassService"):PlayerHasPass(Player, 96480229) then game.Workspace.Door.Transparency = 0.5 game.Workspace.Door.CanCollide = false wait(2) game.Workspace.Door.Transparency = 0 game.Workspace.Door.CanCollide = true else local h = hit.Parent:findFirstChild("Humanoid") if h~=nil then h.Health = 0 end end end
script.Parent.Touched:connect(onTouched)
It won't let me go through the door when I try to go through. What have I done wrong? Please help! |
|
|
| Report Abuse |
|
|
| |
|
|
| 30 Oct 2012 05:08 PM |
Player isn't defined.
function onTouched(hit) if hit.Parent:findFirstChild("Humanoid") then Player = game.Players[hit.Parent.Name] if Game:GetService("GamePassService"):PlayerHasPass(Player, 96480229) then game.Workspace.Door.Transparency = 0.5 game.Workspace.Door.CanCollide = false wait(2) game.Workspace.Door.Transparency = 0 game.Workspace.Door.CanCollide = true else local h = hit.Parent:findFirstChild("Humanoid") if h~=nil then h.Health = 0 end end end end script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|