Bosoe
|
  |
| Joined: 28 May 2011 |
| Total Posts: 1021 |
|
|
| 06 Dec 2011 11:06 AM |
print("Bosoe's Door Script loaded") permission = {"Bosoe", "wargarkaztestplace", "Player3"} door = script.Parent.Parent.Door script.Parent.ClickDetector.MouseClick:connect(function(clickie) script.Parent.ClickDetector.MaxActivationDistance = 0
function checkOkToLetIn(name) for i = 1,#permission do if (string.upper(name) == string.upper(permission[i])) then return true end end return false end
local Door = script.Parent
function onTouched(hit) print("Door Hit") local human = hit.Parent:findFirstChild("Humanoid") if (human ~= nil ) then print("Human touched door") if (checkOkToLetIn(human.Parent.Name)) then for i = 1, 20 do wait(0.03) door.CFrame = door.CFrame + Vector3.new(0.3,0,0) end wait(2) for i = 1, 20 do wait(0.03) door.CFrame = door.CFrame + Vector3.new(-0.3,0,0) end script.Parent.ClickDetector.MaxActivationDistance = 15 end) end end
script.Parent.Touched:connect(onTouched)
Basicly a VIP Door that slides when you walk into it then goes back, but dosen't work. |
|
|
| Report Abuse |
|
yelloball
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 2749 |
|
|
| 06 Dec 2011 11:39 AM |
Im not 100% (Im not so good on scripting). But you said Local Door With captical D And on this line : door.CFrame = door.CFrame + Vector3.new(0.3,0,0) You didnt.
|
|
|
| Report Abuse |
|
789cab
|
  |
| Joined: 13 Jul 2009 |
| Total Posts: 3145 |
|
|
| 06 Dec 2011 12:43 PM |
| For the click detector, you need a click detector on the objects in studio mode... Go to insert at the top, go to object, then look for ClickDetector |
|
|
| Report Abuse |
|