Can't access frame that is in playergui returned through remote function?
I have the remote function:
01 | local event = game.ReplicatedStorage.Work.genhud |
03 | local function genHUD() |
04 | local jobHUD = game.ReplicatedStorage.jobHUD |
05 | local hud = jobHUD:Clone() |
06 | hud.Parent = player.PlayerGui.mainHUD |
10 | event.OnClientInvoke = genHUD |
But whenever I call it in a server script, it says that hud is nil for some reason?
1 | local event = game.ReplicatedStorage.Work.genhud |
3 | script.MouseButton 1 Click:Connect( function () |
5 | local hud = event:InvokeClient(player) |
Should I add that this event works perfectly in studio, it just doesn't work in game.