of     1   

zaniac10
#149898607Sunday, November 16, 2014 9:01 PM GMT

local db = false script.Parent.Touched:connect(function(hit) local plr = game:service("Players"):GetPlayerFromCharacter(hit.Parent) if plr:GetRankInGroup(1203527) >= 75 then if db == true then return; end db = true script.Parent.Transparency = 0.6 script.Parent.CanCollide = false wait(1) script.Parent.Transparency = 0 script.Parent.CanCollide = true db = false else return print("Player not HR, ending function.") end end) if the player has a rank of 75 and up, it'll allow them to access the door. if they're not, it'll end the function.
zaniac10
#149898674Sunday, November 16, 2014 9:02 PM GMT

output error: 12:58:23.166 - Workspace.owneronlydoor.OwnerOnlyDoor.Script:5: attempt to index local 'plr' (a nil value)
Uraganul77
#149898704Sunday, November 16, 2014 9:02 PM GMT

I think you need to put rank name not number.
zaniac10
#149898741Sunday, November 16, 2014 9:03 PM GMT

that's whet GetRoleInGroup does GetRankInGroup gets their permission number.
Uraganul77
#149898811Sunday, November 16, 2014 9:04 PM GMT

Well i dont know...
zaniac10
#149898853Sunday, November 16, 2014 9:04 PM GMT

it might be vice versa idk
JarodOfOrbiter
#149898900Sunday, November 16, 2014 9:05 PM GMT

Check if plr is nil first.
JarodOfOrbiter
#149898960Sunday, November 16, 2014 9:06 PM GMT

And if it was vice versa, it would error. And I'm sure you checked the output?
zaniac10
#149899032Sunday, November 16, 2014 9:06 PM GMT

local db = false script.Parent.Touched:connect(function(hit) local plr = game:service("Players"):GetPlayerFromCharacter(hit.Parent) if plr:GetRoleInGroup(1203527) >= 75 then if db == true then return; end if plr ~= nil then db = true script.Parent.Transparency = 0.6 script.Parent.CanCollide = false wait(1) script.Parent.Transparency = 0 script.Parent.CanCollide = true db = false else return print("Player not HR, ending function.") end end end) output error: 13:06:38.492 - Workspace.owneronlydoor.OwnerOnlyDoor.Script:5: attempt to index local 'plr' (a nil value)
JarodOfOrbiter
#149899240Sunday, November 16, 2014 9:09 PM GMT

Yep. check if it is nil.
zaniac10
#149899282Sunday, November 16, 2014 9:10 PM GMT

.. How?
JarodOfOrbiter
#149899375Sunday, November 16, 2014 9:11 PM GMT

if plr then --Do stuff end
zaniac10
#149900068Sunday, November 16, 2014 9:20 PM GMT

local db = false script.Parent.Touched:connect(function(hit) local plr = game.Players:findFirstChild(hit.Parent.Name) if plr:GetRoleInGroup(1203527) >= 75 then if plr then if db == true then return; end db = true script.Parent.Transparency = 0.6 script.Parent.CanCollide = false wait(1) script.Parent.Transparency = 0 script.Parent.CanCollide = true db = false else return print("Player not HR, ending function.") end end end) has still not worked.

    of     1