I have the remote function:
local event = game.ReplicatedStorage.Work.genhud
local function genHUD()
local jobHUD = game.ReplicatedStorage.jobHUD
local hud = jobHUD:Clone()
hud.Parent = player.PlayerGui.mainHUD
return hud
end
event.OnClientInvoke = genHUD
But whenever I call it in a server script, it says that hud is nil for some reason?
local event = game.ReplicatedStorage.Work.genhud
script.MouseButton1Click:Connect(function()
local hud = event:InvokeClient(player)
print(hud)
end)
Should I add that this event works perfectly in studio, it just doesn't work in game.

1 comment
the reason why it's printing nil is because the server can't see a player's gui, rather once it is cloned and you know it's cloned there's no reason to return any value