Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

player isingroup and getrankingroup bug?

Asked by
Nimbzee 14
4 years ago

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

Log in to vote
0
Answered by 4 years ago

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!

0
ah yes, the worst mistake Nimbzee 14 — 4y
Ad

Answer this question