When i test it in edit (play solo) it works fine but when i publish it and go in a online server, i get this error in the server output : Workspace.Merchant.Shop.ClickDetector.Shop:3 attempt to index local 'player' (a nil value)
this is the script (not a local script)
function onTouched()
local player = game.Players.LocalPlayer
player.PlayerGui.Shop.Shop.Visible = true
end
script.Parent.MouseClick:connect(onTouched)

1 comment
You cannot access LocalPlayer through regular scripts