Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Tool0 = Instance.new("Tool")
- Part1 = Instance.new("Part")
- SpecialMesh2 = Instance.new("SpecialMesh")
- Sound3 = Instance.new("Sound")
- Script4 = Instance.new("Script")
- Tool0.Name = "Bawmbuzx"
- Tool0.Parent = mas
- Part1.Name = "Handle"
- Part1.Parent = Tool0
- Part1.Size = Vector3.new(4, 1, 2)
- Part1.CFrame = CFrame.new(32.3099976, 0.500003994, -21.2999992, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part1.BottomSurface = Enum.SurfaceType.Smooth
- Part1.TopSurface = Enum.SurfaceType.Smooth
- Part1.Position = Vector3.new(32.3099976, 0.500003994, -21.2999992)
- SpecialMesh2.Parent = Part1
- SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=151760030"
- SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=151760072"
- SpecialMesh2.MeshType = Enum.MeshType.FileMesh
- Sound3.Parent = Part1
- Sound3.Pitch = 1.1499999761581
- Sound3.SoundId = "rbxassetid://366816774"
- Sound3.Volume = 5
- Sound3.Looped = true
- Script4.Name = "LocalWeldScript"
- Script4.Parent = Tool0
- table.insert(cors,sandbox(Script4,function()
- -- Simple Welding Script by Fusion_Swarly. No credit necessary.
- --[[
- To use, Simply place this inside the model you want to use. If you want the model unanchored, Set unanchor to true. If not, set it to
- false. If there are any part classes in your model that aren't in the class list, Just add it in. Make sure to use the EXACT name.
- MAKE SURE THE ENIRE MODEL IS ANCHORED BEFORE USE! Otherwise all the parts will glitch and go out of place and they'll look ugly.
- If you want to remove all welds from your model, Just set removeWelds to true. (If you ever used the qPerfectionWeld script, This will
- also remove all those annoying CFrame values as well.)
- --]]
- unanchor = false
- removeWelds = false
- classes = {
- "Part";
- "WedgePart";
- "TrussPart";
- "CornerWedgePart";
- "Seat";
- "VehicleSeat";
- "UnionOperation";
- "NegateOperation";
- "MeshPart";
- "SpawnLocation";
- }
- -- Don't edit anything down here unless you know what you're doing.
- function createWeld(p1, p2)
- local weld = Instance.new("Weld", p1)
- weld.C0 = p1.CFrame:inverse() * p2.CFrame
- weld.Part0 = p1
- weld.Part1 = p2
- end
- function checkWelds(model)
- local prev
- local c = model:GetChildren()
- for i = 1, #c do
- for a = 1, #classes do
- if c[i].ClassName == classes[a] then
- local oldWeld = c[i]:FindFirstChildOfClass("Weld")
- if oldWeld ~= nil then
- oldWeld:Destroy()
- end
- local oldCFrame = c[i]:FindFirstChildOfClass("CFrameValue")
- if oldCFrame ~= nil then
- oldCFrame:Destroy()
- end
- if removeWelds == false then
- if unanchor == true then
- c[i].Anchored = false
- end
- if prev ~= nil then
- createWeld(prev, c[i])
- end
- prev = c[i]
- end
- end
- end
- checkWelds(c[i])
- end
- end
- checkWelds(script.Parent)
- end))
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = script
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement