If I wanted to use functions within a ModuleScript function, they don’t work. How would I do this properly?
An example would look like this:
local Module = {}
function Module.CarScript()
function destroyWheels()
local Wheel = script.Parent.Car.Wheel
Wheel:Destroy()
end
destroyWheels()
end
return Module
You can have the function outside the main function like this:
local Module = {}
function destroyWheels()
local Wheel = script.Parent.Car.Wheel
Wheel:Destroy()
end
function Module.CarScript()
destroyWheels()
end
return Module