Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

attempt to index global 'player' (a nil value) error , how to fix ?

Asked by 4 years ago
player.PlayerGui.ScreenGui.Frame.Visible=false
player.PlayerGui.ScreenGui.ARROW.Visible=false
player.PlayerGui.ScreenGui.CONVERSION.Visible=false

I did this and this error showed up at the output

0
Did you define 'player' what is it defined as, is this a localscript? Serverscript? You haven't explained or showed us anything Nanomatics 1160 — 4y
0
Oh ok , next time I will ... Thx rupertrosse 39 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

You have to define the Player. The way to do this in a local script would be:

Players = game:GetService("Players")
local Player = Players.LocalPlayer

Hope this helps.

Ad

Answer this question