AdSomnum
(kai)
#1
The title says it all.
For some reason, my script to show a players’ rank inside my group isn’t working.
It just doesn’t display their rank on the text label.
Script: (This is the local script shown in the first screenshot named rank)
local groupid = 11954854
local label = script.Parent
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function()
wait(2)
label.Text = "Rank: "..plr:GetRoleInGroup(groupid)
end)
end)
1 Like
Replace:
with:
local groupid = 11954854
local label = script.Parent
local plr = game.Players.locaplayer
label.Text = "Rank: "..plr:GetRoleInGroup(groupid)
1 Like
add a print so use:
local groupid = 11954854
local label = script.Parent
local plr = game.Players.locaplayer
local rank = plr:GetRoleInGroup(groupid)
print(rank)
label.Text = "Rank: "..rank
let me know if it prints the rank or not
AdSomnum
(kai)
#5
Nothing printed
thank you for responding
just to confirm this script is deffenately local correct? i do not see a reason it should execute if so.
AdSomnum
(kai)
#7
Yes, it is definitely a local script.
maybe try putting a print at the very top of the script and if that does not work then i am not sure, maybe restart studio?
AdSomnum
(kai)
#9
I see why it didn’t work.
You put “locaplayer” instead of “LocalPlayer” in the script you gave me
I replaced it with LocalPlayer and it works
Sorry I am not in studio when i typed that and forgot to capitalize that… my mistake…
Discord: kieranl29_#3816
AdSomnum
(kai)
#11
Thank you for helping, your reply was marked as the solution!
1 Like
system
(system)
Closed
#12
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.