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

Update Group Role In-Game?

Asked by 5 years ago
Edited 5 years ago

I've created an over head GUI using a billboard GUI, and a TextLabel inside of the billboard GUI. Although when a player is refreshed in game it will not update the group rank if their rank has been changed. The server has to be shutdown in order for their ranks to update. How can this be fixed?

local billboardgui = game:GetService("ServerStorage"):WaitForChild("BillboardGui")

game.Players.PlayerAdded:Connect(function(player)

    player.CharacterAdded:Connect(function(character)

    if player:IsInGroup(2597387) then
            wait(2)
            local clonedgui = billboardgui:Clone()
            clonedgui.TextLabel.Text = player:GetRoleInGroup(2597387)
            clonedgui.TextLabel.TextColor3 = Color3.fromRGB(255, 0, 0)
            clonedgui.Parent = game.Workspace:WaitForChild(player.Name).Head
        end

    end)

end)
0
You cannot do this as on the server the result is cached. You can get the updated role by sending it to the server from the client, however since the client is sending this information an exploiter can send bad information. The best you can do is kick the player. User#24403 69 — 5y
0
So what needs to be done differently in the code then? CrazyWildMonkeys 0 — 5y
0

Answer this question