I am making a minigame type game and when a round ends, a Gui goes on everyone's screens that tells them who won. Well, my core game loop isn't working because my Gui function keeps erroring.
Here is my error message.
20:39:10.170 - Workspace.Editing:110: attempt to index local 'plr' (a nil value)
Why am I getting this? I can't find a workaround or solution for it.
function winnerGui()
local plr = game.Players.LocalPlayer
local plrGui = plr:WaitForChild("PlayerGui")
local winnerGui = Instance.new("ScreenGui")
winnerGui.Parent = plrGui
end

2 comments
Thank you! I wasn't aware of that.
what's up with the thumb down someone gave here?