Group rank door | Scripting support

:wave:| Hi there cookie tech I’m recently having errors with my group rank door this only seemed to be starting yesterday these have been working for months. All part names are correct I just can’t find the error.

local door = game.Workspace.BakeryRD
local player = game.Players.LocalPlayer

if player:GetRankInGroup(15175464) >= 5 then
	door.CanCollide = false
else
end

Hi, can you edit your original post and add code tags?

Yeah i know i have to do that but how?

I would reccommend :mag: before asking!

Alright, check the logs, do you have any errors?

No there is nothing in the dev console if there was something i would have known the error.

Alright, first things first, remove the “else”, it’s not needed, where is this script located and what type of script is it?

Its a local script located in startergui

How many of these scripts do you have?

All the group doors are in one script

Show me the entire script.

local door = game.Workspace.BakeryRD

local door2 = game.Workspace.StaffRoomDoor

local player = game.Players.LocalPlayer

if player:GetRankInGroup(15175464) >= 5 then

door.CanCollide = false

if player:GetRankInGroup(15175464) >= 5 then

door2.CanCollide = false

end

end

Yeh, the “end” is a big messed up…

Try this:

local door = game.Workspace.BakeryRD

local door2 = game.Workspace.StaffRoomDoor

local player = game.Players.LocalPlayer

if player:GetRankInGroup(15175464) >= 5 then

door.CanCollide = false

end

if player:GetRankInGroup(15175464) >= 5 then

door2.CanCollide = false

end

Still not working :thinking: No clue why now

:melting_face: Hmm, how are you testing this?

Studio need me to test it in-game? ( I try to walk through it but it does not work )

Update: I’ve just updated in-game and I’m still having the same errors.

Are you testing with a player that has the appropriate role?

Try it with one door and add some handling:

local door = game.Workspace.BakeryRD


local player = game.Players.LocalPlayer

 if player:GetRankInGroup(15175464) >= 5 then

door.CanCollide = false

else 
  print("Player does not have the correct rank.")

end

Im testing it myself I own the group :thinking:

Try using this in-game, see if you get “Player does not have the correct rank”.