For example, I want to do this:
local module = {} function module.destroyPart() workspace:FindFirstChild("ClonedPart"):Destroy() print("Destroyed :)") end function createpart() Cloned = workspace.part:Clone() Cloned.Name = "ClonedPart" wait(5) --How would I do this?: (I just guessed on how to do it below) module.destroyPart() end return module
That would work. However you would need to call createpart from a script, so instead of making it a normal function, make it a module function by simply making it module.createpart.
Just require the module script in the module script and start the function. Make sure the module script with the function and the module script calling the function have different name. replace "name" with full name of module script with function and replace function with the function to be called.
require(name) name.function()