generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

help diagnosing this owner door script (string value)

Previous Thread :: Next Thread 
ExtraTelamon is not online. ExtraTelamon
Joined: 26 Dec 2011
Total Posts: 4629
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
ExtraTelamon is not online. ExtraTelamon
Joined: 26 Dec 2011
Total Posts: 4629
09 Nov 2014 09:38 AM
bump
Report Abuse
128GB is not online. 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
ExtraTelamon is not online. ExtraTelamon
Joined: 26 Dec 2011
Total Posts: 4629
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 is not online. 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
ExtraTelamon is not online. ExtraTelamon
Joined: 26 Dec 2011
Total Posts: 4629
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image