I'm making a game that has a mechanic where when you hover over something a gui pops up.
serverStorage = game:GetService("ServerStorage") tester1 = workspace.tester1 local player = game.Players.LocalPlayer local clickDetector = Instance.new("ClickDetector", tester1) script.Parent.ClickDetector.MouseHoverEnter:connect(function(Player) local guit = serverStorage.hoverf:Clone() guit.Parent = player.PlayerGui end)
Problem is that I get this error: 07:38:41.243 - Workspace.tester1.Script:10: attempt to index upvalue 'player' (a nil value)
From your script I can tell it is a Script and not a LocalScript. Scripts can't use game.Players.LocalPlayer. You'll need to define the player differently.
EDIT:
local ReplicatedStorage = game:GetService("ReplicatedStorage") local tester1 = workspace:WaitForChilD("tester1") local player = game.Players.LocalPlayer local clickDetector = Instance.new("ClickDetector", tester1) script.Parent.ClickDetector.MouseHoverEnter:connect(function(Player) local guit = ReplicatedStorage.hoverf:Clone() guit.Parent = player.PlayerGui end)
Put that script in ReplicatedFirst