#How do I convert a module script into normal script language.
20 messages · Page 1 of 1 (latest)
** You are now Level 2! **
Just create a new script then copy the contents of the module script into it. Then don't return anything at the end of the script
Though if you have a module script just require it from another script and use it.
But why not just call the module from a localscript?
** You are now Level 1! **
because im not interested in using the module
i need it plain local script
the module script is returning something at the end, right?
then it's not a module script. If it's just functionality you need from the script, copy it into a new script somewhere under 'StarterPlayer`
So a module script might look like this, say somewhere in replicated storage:
local Util = {}
function Util.PrintVector(inVec)
return "(" .. inVec.X .. "," .. inVec.Y .. "," .. inVec.Z .. ")"
end
return Util
So if I want to use that from a client (localstorage) script, I'd go something like:
local RS = game:GetService("ReplicatedStorage")
local Util = require(RS:WaitForChild("Common"):FindFirstChild("util")) -- assuming script is under ReplicatedStorage and called 'util.rs'
local vec = Vector3.new()
Util.PrintVector(vec)