oskxzr
(IJBOL)
#1
How do I run a function on a module by using just require(module)
?
I have seen this done before but I am not sure how to do it.
Server script:
require(game.ReplicatedStorage.MainModule)
Module:
return function()
local Hint = Instance.new("Hint", workspace)
Hint.Text = "Working!"
end
Nothing happens? How do I make this work without changing the server script?
Thanks!
cjjdawg
(cjjdawg)
#2
Your module is returning a function so if you want it to execute it just call it 
require(game.ReplicatedStorage.MainModule)()
Hints are depreciated btw.
oskxzr
(IJBOL)
#3
How can I make my module run code without changing what is inside the server script?
cjjdawg
(cjjdawg)
#4
Could you elaborate more I don’t understand.
cjjdawg
(cjjdawg)
#5
If you want the code to run when you require it just put it inside of the body:
local Hint = Instance.new("Hint", workspace)
Hint.Text = "Working!"
return
Although this defeats the purpose of modules.