So with the whole loadlibrary being removed thing, how would I go about fixing this? Its just a little part of the script but I am stumped how to fix it?
local RbxUtility = require(game:GetService("ReplicatedStorage"):WaitForChild("LoadLibrary"):WaitForChild("RbxUtility"))
Create = RbxUtility.Create
Is LoadLibrary directly inside ReplicatedStorage along with RbxUtility inside it?
This function you’re trying to use is simple to re-create and optimise anywho:
local function create(className, properties)
local new = Instance.new(className)
for property, value in pairs(properties) do
if not property == "Parent" then
new[property] = value
end
end
new.Parent = properties.Parent
--// Parent it lastly, otherwise roblox would need to handle replication jobs etc
--// If properties.Parent is nil then it'll stay in nil anyways
return new
end
Think of it as a primitive ModuleScript that was global and full of mostly awful made functions.
For a more accurate recreation of Create, which I still wouldn’t recommend, use this.
local next = next
local function Make(InstanceType)
local function ClosureFunction(Table, ...)
local Object = Instance.new(InstanceType)
local Parent = Table.Parent
if Parent then
Table.Parent = nil
end
for Property, Value in next, Table do
if type(Property) == "number" then
Value.Parent = Object
else
Object[Property] = Value
end
end
if Parent then
Object.Parent = Parent
end
if ... then
local Length = select("#", ...)
local Objects = {...}
--for a = 1, Length do
for a, OtherObject in next, Objects do
local Object = Object:Clone()
for Property, Value in next, OtherObject do
if type(Property) == "number" then
Value.Parent = Object
else
Object[Property] = Value
end
end
Object.Parent = not Object.Parent and Parent
Objects[a] = Object
end
return Object, table.unpack(Objects, 1, Length)
else
return Object
end
end
return ClosureFunction
end
return Make