This gui is shown when a players kills reach 2. But, I have a error with this.

local plr = game.Players.LocalPlayer
moved = false

while true do
	wait(5)
	if moved == false and plr.leaderstats.Kills.Value == 2 then
		moved = true
    	plr.PlayerGui.nicekills.MainFrame.Background.TextLabel:TweenPosition(UDim2.new(0, 0, 2.5, 0), "Out", "Bounce", 2)
		wait(7)
		plr.PlayerGui.nicekills.MainFrame.Background.TextLabel:TweenPosition(UDim2.new(0, 0, 5, 0), "Out", "Quad", 1)
	end
	wait(1)
end

ERROR: Players.MrSmenryBackup.PlayerGui.nicekills.MainFrame.Backgr:6: attempt to index local 'plr' (a nil value)

2 comments

0

Is this in a LocalScript?

0

Oh.