game.Players.PlayerAdded:Connect(function(player) local ms = require(script.ModuleScript) local groupService = game:GetService('GroupService') local groups = groupService:GetGroupsAsync(player.UserId) wait(1) local ui = script.Rank:Clone() ui.Parent = player.Character.Head ui.Adornee = player.Character.Head while not player.Character.Humanoid do wait() end player.Character.Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None local frame = ui.Frame local name = frame.Main local title = frame.Title while true do for _,groupInfo in pairs(groups) do if groupInfo.Id == 4489568 then if v.Role == "President" or v.Role == "Vice President" or v.Role == "Developmental Staff" then name.Text = player.Name.. ", "..v.Role print("Name updated") wait(1) end end end end end)
Error: ServerScriptService.RankHandler:21: attempt to index global 'v' (a nil value)
How to fix this?