chore: refractor
This commit is contained in:
26
Workspace/mods/mc/init.lua
Normal file
26
Workspace/mods/mc/init.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
--!native
|
||||
--!optimize 2
|
||||
|
||||
local mod = {
|
||||
name = "Blockscraft",
|
||||
description = "Base Blockscraft blocks",
|
||||
ns = "mc",
|
||||
author = { "ocbwoy3" }
|
||||
}
|
||||
|
||||
local rep = game:GetService("ReplicatedStorage"):WaitForChild("Blocks")
|
||||
local upd = game:GetService("ReplicatedStorage"):WaitForChild("BlockUpdateOperations")
|
||||
|
||||
function mod.init()
|
||||
for a,b in pairs(script.blocks:GetChildren()) do
|
||||
local upop = b:FindFirstChild("BlockUpdateOperation")
|
||||
if upop then
|
||||
upop.Name = b:GetAttribute("n")
|
||||
upop:SetAttribute("n",b:GetAttribute("n"))
|
||||
upop.Parent = upd
|
||||
end
|
||||
b:Clone().Parent = rep
|
||||
end
|
||||
end
|
||||
|
||||
return mod
|
||||
3
Workspace/mods/mc/init.meta.json
Normal file
3
Workspace/mods/mc/init.meta.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"ignoreUnknownInstances": true
|
||||
}
|
||||
3
Workspace/mods/mc/upds/BlockUpdateOperation.lua
Normal file
3
Workspace/mods/mc/upds/BlockUpdateOperation.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
return function(p: typeof(script.Parent.Parent.blocks["mc:grass_block"]))
|
||||
p.block.Grass.Color = Color3.new(p:GetAttribute("x"),p:GetAttribute("x"),p:GetAttribute("x"))
|
||||
end
|
||||
3
Workspace/mods/mc/upds/init.meta.json
Normal file
3
Workspace/mods/mc/upds/init.meta.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"ignoreUnknownInstances": true
|
||||
}
|
||||
Reference in New Issue
Block a user