Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

player isingroup and getrankingroup bug?

im making a StarWars game, and there is a group owned by me.

i have a gui that is there when u start the game, and u pick your lightsaber.

but its only IF YOUR IN the group.

so when i was testing, everything seemed to be working fine. until i joined on my alt, joined the SAME group and the gui would not work for my alt, but would for my main,

code for gui:

script.Parent.MouseButton1Down:Connect(function(plr)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
 
local remoteEvent = ReplicatedStorage.remotes:WaitForChild("RemoteEvent")

remoteEvent:FireServer()
end)

so then it transfers to the server script:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
 
local remoteEvent = ReplicatedStorage.remotes:WaitForChild("RemoteEvent")
local function click(plr)
	
local tool = game.ServerStorage.Vibrosaber

	
	if plr:GetRankInGroup(5410728) >= 251  then
	local tool2 = tool:Clone()
	tool2.Parent = plr.Backpack
	script.Parent.Parent.Parent:Destroy()
	else
		print("not in group")
	end
	end
	
	




remoteEvent.OnServerEvent:Connect(click)

keep in mine the lowest rank is 251 and im making all rank above 251 can use it. but (yes alt is in group) https://gyazo.com/e003c3bb890f2f6c329f09c27ad67b81

my main account gets it, as seen in this gif: https://gyazo.com/5e03d4ca49cbe1b271582c6887acd754

but it doesn't do squat in the other account: https://gyazo.com/da55a6a3daef1c8ec998ecc5b3e6a0cb

if you really need to see that they are in the group, it is and the alt is Zexqul https://www.roblox.com/groups/6014924/Temple-Guards#!/about

could this be a bug? or am i stupidly missing something

1 answer

✓ Accepted answer

I think the issue here is that you just put in the wrong Group ID. According to the group link you gave me, line 9 should read:

if plr:GetRankInGroup(6014924) >= 251  then

Otherwise, your code looks great!

1 comment

0

ah yes, the worst mistake

This discussion is preserved as it was. New answers, comments, and votes are closed.