Attempt to concatenate string with nil issue

So I’m trying to make a players name appear on the GUI and here’s the script:

local pservice = game:GetService("Players")
local plr = game.Players.LocalPlayer.Name

script.Parent.Text = "Welcome  " .. plr.Name

but I get this error:

Players.imwatchingyou_haha1.PlayerGui.Gui.Frame.TextLabel.LocalScript:4: attempt to concatenate string with nil - Client - LocalScript:4

Here ur saying LocalPlayer.Name

And here

Ur saying again plr.Name so ur making LocalPlayer.Name.Name

Working script

local pservice = game:GetService("Players")
local plr = game.Players.LocalPlayer

script.Parent.Text = "Welcome  " .. plr.Name
3 Likes

Ah ok, thanks for telling me. It works.