Return GUI with Module

How can I make a screengui which is a child of a module script go to starter Gui when the module is required?

This seems pretty simple, its just something like this

local module = {}

function module:GiveGui(plr)
      local c = script.gui:Clone().
      c.Parent = plr.PlayerGui
      return c
end

return module

sorry for random edits spacebar is weird.

you can also just return a function and run that.
(i have no idea if this works but just having code out of the function to get when required may work?)

1 Like