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

Hello, this script used to work with another script but I can't seem to figure it out anymore?

Asked by
hopup 15
6 years ago
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?

0
v is nil User#23365 30 — 6y
0
you didnt define it User#23365 30 — 6y
0
And when I define it, I get this error: ServerScriptService.RankHandler:21: attempt to index local 'v' (a number value) hopup 15 — 6y
0
you never defined `v` you defined `groupInfo`. You use that instead of `v` since v doesn't exist supercoolboy8804 114 — 6y
0
^ turtle2004 167 — 6y

Answer this question