I maked a Mouse text on a hover thing for my door but it isn't working the problem is that: Workspace.Mouse Text on hover.Script:6: attempt to index field 'LocalPlayer' (a nil value) And i can't fix it any help? and the script is here: SCRIPT:
local sg = script.Parent:GetChildren() for i = 1, #sg do if sg[i].className == "SurfaceGui" then sg[i].TextLabel.MouseEnter:connect(function() game.Players.LocalPlayer.PlayerGui.MouseText.NewMouse.Visible = true game.Players.LocalPlayer.PlayerGui.MouseText.NewMouse.IconText.Text = script.Parent.TextValue.Value sg[i].TextLabel.MouseLeave:connect(function() game.Players.LocalPlayer.PlayerGui.MouseText.NewMouse.Visible = false end) end) end end
I have also a GUI and TextValue. and some more SurfaceGUI but still not works, Anyone help?
Make sure that the script is a LocalScript if you wish to use LocalPlayer.
The script should 1) be a localscript to access localplayer and 2) it can't be in workspace to access localplayer, it has to be in the player