|
| 09 Nov 2014 09:31 AM |
local Admin = script.Parent.Parent.Parent.Parent.OwnerName.Value
function checkOkToLetIn(name) for i = 1,#Admin do if (string.upper(name) == string.upper(Admin[i])) then return true end end return false end
local oDoor = script.Parent function onTouched(hit) local plr = hit.Parent:findFirstChild("Humanoid") if (plr ~= nil ) then if (checkOkToLetIn(plr.Parent.Name)) then oDoor.CanCollide = false wait(3) oDoor.CanCollide = true else plr:LoadCharacter() end end end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
| |
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 09 Nov 2014 09:40 AM |
| You tried to use the variable "admin" like a table |
|
|
| Report Abuse |
|
|
|
| 09 Nov 2014 09:42 AM |
well i know that much
i don't know how to use variables to check
i know this part is the problem
function checkOkToLetIn(name) for i = 1,#Admin do if (string.upper(name) == string.upper(Admin[i])) then return true end end return false end |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 09 Nov 2014 09:56 AM |
local whiteList = { ["128GB"] = true; [1] = true; } --Dont put quotes if its userId, userId 1 is roblox script.Parent.Touched:connect(function(object) local player = game.Players:GetPlayerFromCharacater(object.Parent) if player and (whiteList[player.userId] or whiteList[player.Name] then if script.Parent.CanCollide then script.Parent.CanCollide = false wait(3) script.Parent.CanCollide = true end elseif player then player:LoadCharacter() end end) |
|
|
| Report Abuse |
|
|
|
| 09 Nov 2014 09:59 AM |
| but the person that's admin has to be the value of a string i have in the model it's under |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 09 Nov 2014 10:03 AM |
Under the whiteList put this
whiteList[stringValueHere.Value] = true |
|
|
| Report Abuse |
|
|