I recently found a post that somehow fixed two gears that used loadlibrary without the need of modules. Is there any way to do the same for these gears?
Robloxian Clone.rbxm (14.9 KB)
Ultraviolet Blaster.rbxm (32.7 KB)
Plunger Launcher.rbxm (17.2 KB)
Omega Rainbow Sword.rbxm (18.5 KB)
Retro Super Villain Laser Gun.rbxm (19.5 KB)
just put the load library inside of the main script and replace the require part with whatever the modules returned.
with modules:
local loadLibrary = require(script.loadlibrary)
--rest of the code
local loadLibrary = {}
...
return loadLibrary
without modules:
local loadLibrary = {}
--load library code here
--rest of the code
it’s the same as using modules, just less organized
Didn’t work but how would you fix it using Instance.new
I haven’t looked into load library or how it works. But I’m guess that it describes what it creates and what properties it set to what values. You could either
local part = Instance.new("Part")
part.Color = Color3.new(1, 1, 1)
part.Parent = workspace
set all properties manually. Make sure parent is last
or you could make a function that automatically applies properties
function new(class, properties)
local obj = Instance.new(class)
local parent = properties.Parent
for property, value in next, properties do
if (property == "Parent") then continue end
obj[property] = value
end
obj.Parent = parent
return obj
end
make sure you use pcall though to make sure you don’t get any unexpected errors