Created
April 18, 2024 17:24
-
-
Save kezzyhko/39fe927f8c16df99c3d3612547b2820a to your computer and use it in GitHub Desktop.
Script for Roblox to weld uploaded model and add a root part
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local model = game.Selection:Get()[1] | |
local root = Instance.new("Part") | |
root.Name = "RootPart" | |
root.Size = Vector3.one | |
root.EnableFluidForces = false | |
root.CanCollide = false | |
root.CanQuery = false | |
root.CanTouch = false | |
root.Transparency = 1 | |
root:PivotTo(model:GetPivot()) | |
root.Parent = model | |
model.PrimaryPart = root | |
for _, part in pairs(model:GetChildren()) do | |
local weld = Instance.new("WeldConstraint") | |
weld.Parent = part | |
weld.Part0 = part | |
weld.Part1 = root | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment