2DWorlds Forums
How to make a vip door - Printable Version

+- 2DWorlds Forums (http://2dworlds.buildism.net/forum)
+-- Forum: 2DWorlds (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=4)
+--- Forum: 2DWorlds Discussion (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=10)
+---- Forum: Tutorials and Guides (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=20)
+---- Thread: How to make a vip door (/showthread.php?tid=1255)



How to make a vip door - BuildistGuard - 02-04-2011

First copy this script
[lua]allowed = {"YourNameHere", "OtherNameHere"}

function in_table ( e, t )
for _,v in pairs(t) do
if (v==e) then return true end
end
return false
end

function onCollide(part)
if part.Parent:isA("Character") then
local name = part.Parent.Name
if in_table(name, allowed) then
if script.Parent.Collidable then
script.Parent.Collidable = false
script.Parent.Transparency = 0.5
sleep(1)
script.Parent.Collidable = true
script.Parent.Transparency = 0
end
end
end
end

link(script.Parent.Collided, onCollide)[/lua]
Open the "Script" and paste this lua code. Finally change "Yournamehere" and "Othernamehere" and add whatever names you want on the list.No killing is included, but add it if you want. Have fun letting the only players in and the Vip door can be useful for a secret hideout, givers, party,etc.