Hi guys
So i have a brick,that makes a gui appear.There are no errors in the script,and when the server starts this happens in the output:
16:53:25.182 - Workspace.Buildings.islands.Lobby.Stall.Touchy.Script:3: attempt to index local 'plr' (a nil value)
It keeps appearing until my error logger cannot take it anymore and says:
16:53:25.294 - HTTP 429 (HTTP/1.1 429 TOO MANY REQUESTS)
What is going on?heres the script
script.Parent.Touched:Connect(function(hit)
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
plr.PlayerGui.MainMenu.Visible = true
plr.PlayerGui.Note.Visible = true
end)
it says that it is attempting to index a local plr(a nil value) even if there were no errors in the script.what does this mean?Please help

1 comment
GetPlayerFromCharacter will retunr nil if the player is not found allow for this case in your code