This error keeps appearing while it shouldn't Code:

button.MouseButton1Click:Connect(function(plr)
	print(plr.Name)
	if
		script.Parent.Text == "..."
	then
		
		result.Enabled = true

Error: 18:59:42.616 - Players.probeast0101.PlayerGui.ScreenGui.Frame.Player1.Script:8: attempt to index nil with 'Name'

4 comments

0

you need to define plr, you can add this line of code into your script instead using plr parameter

local plr = game.Players.LocalPlayer
0

This is not your entire code, we can only see 7 lines here

0

could you put the entire code? it would be nice to know more so i can attempt to help.

0

MouseButton1Click event does not return the player as argument, so plr is nil like the person said in the comments define plr

 local plr = game.Players.LocalPlayer