local player = game.Players.LocalPlayer local tool for _, v in ipairs(player:GetDescendants()) do if v.Name == "SyncAPI" then tool = v.Parent break end end if not tool then for _, v in ipairs(game.ReplicatedStorage:GetDescendants()) do if v.Name == "SyncAPI" then tool = v.Parent break end end end assert(tool, "F3X SyncAPI could not be found in Player descendants or ReplicatedStorage!") local remote = tool:WaitForChild("SyncAPI"):WaitForChild("ServerEndpoint") local function invoke(args) return remote:InvokeServer(unpack(args)) end local function CreatePart(cf, parent, types) return invoke({ [1] = "CreatePart", [2] = types or "Normal", [3] = cf, [4] = parent or Workspace }) end local function CreateWedge(cf, parent) return CreatePart(cf, parent, "Wedge") end local function CreateCylinder(cf, parent) return CreatePart(cf, parent, "Cylinder") end local function CreateBall(cf, parent) return CreatePart(cf, parent, "Ball") end local function CreateCornerWedge(cf, parent) return CreatePart(cf, parent, "CornerWedge") end local function CreateTruss(cf, parent) return CreatePart(cf, parent, "Truss") end local function delete(part) invoke({ [1] = "Remove", [2] = { [1] = part } }) end local function SetName(part, stringg) invoke({ [1] = "SetName", [2] = { [1] = part }, [3] = stringg }) end local function SetLocked(part, boolean) invoke({ [1] = "SetLocked", [2] = { [1] = part }, [3] = boolean }) end local function CloneParts(partsArray) return invoke({ [1] = "Clone", [2] = partsArray }) end local function SyncParent(part, newParent) invoke({ [1] = "SyncParent", [2] = { [1] = { ["Part"] = part, ["Parent"] = newParent } } }) end local function MovePart(part, newcf) invoke({ [1] = "SyncMove", [2] = { [1] = { ["Part"] = part, ["CFrame"] = newcf } } }) end local function Resize(part, size, cf) invoke({ [1] = "SyncResize", [2] = { [1] = { ["Part"] = part, ["CFrame"] = cf, ["Size"] = size } } }) end local function SetAnchor(boolean, part) invoke({ [1] = "SyncAnchor", [2] = { [1] = { ["Part"] = part, ["Anchored"] = boolean } } }) end local function SetCollision(part, boolean) invoke({ [1] = "SyncCollision", [2] = { [1] = { ["Part"] = part, ["CanCollide"] = boolean } } }) end local function WeldParts(part0, part1) invoke({ [1] = "CreateWelds", [2] = { [1] = { ["Part0"] = part0, ["Part1"] = part1 } } }) end local function Color(part, color) invoke({ [1] = "SyncColor", [2] = { [1] = { ["Part"] = part, ["Color"] = color, ["UnionColoring"] = false } } }) end local function SetMaterial(part, material) invoke({ [1] = "SyncMaterial", [2] = { [1] = { ["Part"] = part, ["Material"] = material } } }) end local function SetTransparency(part, transparency) invoke({ [1] = "SyncMaterial", [2] = { [1] = { ["Part"] = part, ["Transparency"] = transparency } } }) end local function SetReflectance(part, reflectance) invoke({ [1] = "SyncMaterial", [2] = { [1] = { ["Part"] = part, ["Reflectance"] = reflectance } } }) end local function SyncSurface(part, face, surfaceType) invoke({ [1] = "SyncSurface", [2] = { [1] = { ["Part"] = part, ["Face"] = face, ["Surface"] = surfaceType } } }) end local function AddMesh(part) invoke({ [1] = "CreateMeshes", [2] = { [1] = { ["Part"] = part } } }) end local function SetMesh(part, meshid) invoke({ [1] = "SyncMesh", [2] = { [1] = { ["Part"] = part, ["MeshId"] = "rbxassetid://" .. tostring(meshid) } } }) end local function SetTexture(part, texid) invoke({ [1] = "SyncMesh", [2] = { [1] = { ["Part"] = part, ["TextureId"] = "rbxassetid://" .. tostring(texid) } } }) end local function MeshResize(part, size) invoke({ [1] = "SyncMesh", [2] = { [1] = { ["Part"] = part, ["Scale"] = size } } }) end local function SpawnDecal(part, side) invoke({ [1] = "CreateTextures", [2] = { [1] = { ["Part"] = part, ["Face"] = side, ["TextureType"] = "Decal" } } }) end local function AddDecal(part, asset, side) invoke({ [1] = "SyncTexture", [2] = { [1] = { ["Part"] = part, ["Face"] = side, ["TextureType"] = "Decal", ["Texture"] = "rbxassetid://" .. tostring(asset) } } }) end local function NegatePart(part) invoke({ [1] = "Negate", [2] = { [1] = part } }) end local function UnnegatePart(part) invoke({ [1] = "Unnegate", [2] = { [1] = part } }) end local function UnionParts(partsArray) invoke({ [1] = "Union", [2] = partsArray }) end local function SeparateParts(part) invoke({ [1] = "Separate", [2] = { [1] = part } }) end local function AddLight(part, lightType) invoke({ [1] = "CreateLights", [2] = { [1] = { ["Part"] = part, ["LightType"] = lightType or "PointLight" } } }) end local function SyncLight(part, properties) properties["Part"] = part invoke({ [1] = "SyncLight", [2] = { [1] = properties } }) end local function AddDecoration(part, decorType) invoke({ [1] = "CreateDecorations", [2] = { [1] = { ["Part"] = part, ["DecorationType"] = decorType or "Fire" } } }) end local function SyncDecoration(part, properties) properties["Part"] = part invoke({ [1] = "SyncDecoration", [2] = { [1] = properties } }) end