Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local holo_str =
- [[HOLO_NAME = IDX
- holoCreate(HOLO_NAME)
- PARENT
- holoColor(HOLO_NAME, COLOR)
- holoAlpha(HOLO_NAME, ALPHA)
- holoScale(HOLO_NAME, SCALE)
- holoPos(HOLO_NAME, entity():toWorld(POSITION))
- holoAng(HOLO_NAME, entity():toWorld(ANGLES))
- #holoAnim(HOLO_NAME, ANIMATION_NAME, ANIMATION_FRAME, ANIMATION_RATE)
- #holoDisableShading(HOLO_NAME, FULLBRIGHT)
- holoMaterial(HOLO_NAME, MATERIAL)
- holoModel(HOLO_NAME, MODEL)
- holoSkin(HOLO_NAME, SKIN)
- ]]
- local function tovec(vec) return ("vec(%s, %s, %s)"):format(math.Round(vec.x, 4), math.Round(vec.y, 4), math.Round(vec.z, 4)) end
- local function toang(vec) return ("ang(%s, %s, %s)"):format(math.Round(vec.p, 4), math.Round(vec.y, 4), math.Round(vec.r, 4)) end
- local function part_to_holo(part)
- local holo = holo_str
- :gsub("IDX", util.CRC(part:GetName()))
- :gsub("ALPHA", part:GetAlpha()*255)
- :gsub("COLOR", tovec(part:GetColor()))
- :gsub("SCALE", tovec(part:GetScale()))
- :gsub("ANGLES", toang(part:GetAngles()))
- :gsub("POSITION", tovec(part:GetPosition()))
- :gsub("MATERIAL", ("%q"):format(part:GetModel()))
- :gsub("MODEL", ("%q"):format(part:GetModel()))
- :gsub("SKIN", part:GetSkin())
- -- not yet implemented
- --:gsub("FULLBRIGHT", part:GetFullbright()) -- forgot to implement this in pac lol
- --:gsub("ANIMATION_NAME", tovec(part:GetScale()))
- --:gsub("ANIMATION_FRAME", tovec(part:GetScale()))
- if part:HasParent() and part:GetParent().ClassName == "model" then
- holo = holo:gsub("PARENT", ("holoParent(HOLO_NAME, %s)"):format(util.CRC(part:GetParent():GetName())))
- else
- holo = holo:gsub("PARENT", "holoParent(HOLO_NAME, entity())")
- end
- holo = holo:Replace("HOLO_NAME", "PAC_" ..part:GetName():gsub("%p", ""):gsub(" ", "_"))
- return holo
- end
- function ToHolo(part)
- local out = ""
- if part.ClassName == "model" then
- out = part_to_holo(part)
- end
- for key, part in pairs(part:GetChildren()) do
- if part.ClassName == "model" then
- out = out .. ToHolo(part)
- end
- end
- return out
- end
- file.Write("expression2/asdf.txt", ToHolo(pace.current_part:GetRootPart()))
Advertisement
Add Comment
Please, Sign In to add comment