Hi everyone, I would like to ask for some help. I have a textbox, and I want to change it accordingly to your group rank, I want it to be client sided, so I need to use a LocalScript. But I can't get it to work! Any help would be appreciated! Here is my current script:
local Frame = game.Workspace.CONTROLS.SurfaceGui.Frame local Scrolling = game.Workspace.CONTROLS.SurfaceGui.ScrollingFrame game.Players.PlayerAdded:Connect(function(Player) if Player:GetRankInGroup(5907099) >= 254 then Frame.Visible = false Scrolling.Visible = true else Frame.Visible = true Scrolling.Visible = false end end)
Thank you again, any help is appreciated!
This would be your serverscript:
rp = game:GetService("ReplicatedStorage") playergroup = rp:WaitForChild("PlayerGroup") -- Make a remoteevent called PlayerGroup that's located in ReplicatedStorage game.Players.PlayerAdded:Connect(function(plr) local rank = plr:GetRoleInGroup(5907099) print(plr, "is", rank) -- This is useful for testing playergroup:FireAllClients(plr, rank) end)
and this your localscript:
local textlabel = script.Parent-- Specify where it is located. I recommend putting this localscript under the textlabel local rp = game:GetService("ReplicatedStorage") local playergroup = rp:WaitForChild("PlayerGroup") player = game.Players.LocalPlayer local Frame = game.Workspace.CONTROLS.SurfaceGui.Frame local Scrolling = game.Workspace.CONTROLS.SurfaceGui.ScrollingFrame playergroup.OnClientEvent:connect(function(plr, rank) if plr ~= nil and plr.Name == player.Name and player:GetRankInGroup(5907099) >= 254 then textlabel.Text = rank textlabel.Visible = true end end)