I made a script to put inside an admin door and everytime I touched the door, it said in the output
attempt to index nil with 'GetRankInGroup'
So, I'm really confused, here is my script:
01 | local adminDoor = script.Parent |
02 | local Players = game:GetService( "Players" ) |
03 |
04 | adminDoor.Door.Touched:Connect( function (hit) |
05 | local char = hit.Parent |
06 | local player = Players:GetPlayerFromCharacter(char) |
07 |
08 | local rank = player:GetRankInGroup( 5567779 ) |
09 | if rank > = 3 then |
10 | game.ReplicatedStorage.AdminFound:FireClient(player) |
11 | elseif rank < 3 then |
12 | adminDoor.Door.CanCollide = true |
13 | end |
14 | end ) |
Maybe try this -
01 | local adminDoor = script.Parent |
02 | ocal Players = game:GetService( "Players" ) |
03 |
04 | adminDoor.Door.Touched:Connect( function (hit) |
05 | local char = hit.Parent |
06 | local player = Players:GetPlayerFromCharacter(char) |
07 |
08 | local rank = player:GetRankInGroup( 5567779 ) > = 3 then |
09 | game.ReplicatedStorage.AdminFound:FireClient(player) |
10 | else |
11 | adminDoor.Door.CanCollide = true |
12 | end |
13 | end ) |