Group Rank Door Not Working

Hi! I am having trouble with my rank door. I have followed the tutorial.

Here’s my code:

local Player = game.Players.LocalPlayer
local doorpart = game.Workspace.RankDoor
local groupid = 13986406
local minrank = 4

if Player:GetRankInGroup(groupdid) >== minrank then
	print("Player is at or above minimum rank")
	doorpart.CanCollide = false
else
	print("Player is not at or above minimum rank")
	doorpart.CanCollide = true
end

I’ve read all other posts, none helped me + they are all locked.

1 Like

Try this:

local Player = game.Players.LocalPlayer
local doorpart = game.Workspace.RankDoor
local groupid = 13986406
local minrank = 4

if Player:GetRankInGroup(groupid) >= minrank then
	print("Player is at or above minimum rank")
	doorpart.CanCollide = false
else
	print("Player is not at or above minimum rank")
	doorpart.CanCollide = true
end

Also if you trying to make it when a player walks into the part try this:

local Player = game.Players.LocalPlayer
local doorpart = game.Workspace.RankDoor
local groupid = 13986406
local minrank = 4

doorpart.Touched:Connect(function(part)
	if part.Parent:FindFirstChild("Humanoid") then
		if Player:GetRankInGroup(groupid) >= minrank then
			print("Player is at or above minimum rank")
			doorpart.CanCollide = false
		else
			print("Player is not at or above minimum rank")
			doorpart.CanCollide = true
		end
	end
end)

Let me know if this help.

1 Like

That has worked! Thank you for the help, can I ask what was wrong with the script?

1 Like

Yeah sure.

In the first if statement you put “groupdid” instead of groupid

“>==” Should have been >=

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.