zaniac10
|
  |
| Joined: 18 Aug 2009 |
| Total Posts: 10000 |
|
|
| 16 Nov 2014 03:01 PM |
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. |
|
|
| Report Abuse |
|
|
zaniac10
|
  |
| Joined: 18 Aug 2009 |
| Total Posts: 10000 |
|
|
| 16 Nov 2014 03:02 PM |
output error:
12:58:23.166 - Workspace.owneronlydoor.OwnerOnlyDoor.Script:5: attempt to index local 'plr' (a nil value) |
|
|
| Report Abuse |
|
|
|
| 16 Nov 2014 03:02 PM |
| I think you need to put rank name not number. |
|
|
| Report Abuse |
|
|
zaniac10
|
  |
| Joined: 18 Aug 2009 |
| Total Posts: 10000 |
|
|
| 16 Nov 2014 03:03 PM |
that's whet GetRoleInGroup does
GetRankInGroup gets their permission number. |
|
|
| Report Abuse |
|
|
| |
|
zaniac10
|
  |
| Joined: 18 Aug 2009 |
| Total Posts: 10000 |
|
|
| 16 Nov 2014 03:04 PM |
| it might be vice versa idk |
|
|
| Report Abuse |
|
|
|
| 16 Nov 2014 03:05 PM |
| Check if plr is nil first. |
|
|
| Report Abuse |
|
|
|
| 16 Nov 2014 03:06 PM |
| And if it was vice versa, it would error. And I'm sure you checked the output? |
|
|
| Report Abuse |
|
|
zaniac10
|
  |
| Joined: 18 Aug 2009 |
| Total Posts: 10000 |
|
|
| 16 Nov 2014 03:06 PM |
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) |
|
|
| Report Abuse |
|
|
| |
|
zaniac10
|
  |
| Joined: 18 Aug 2009 |
| Total Posts: 10000 |
|
| |
|
| |
|
zaniac10
|
  |
| Joined: 18 Aug 2009 |
| Total Posts: 10000 |
|
|
| 16 Nov 2014 03:20 PM |
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. |
|
|
| Report Abuse |
|
|