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")
- Script1 = Instance.new("Script")
- Part2 = Instance.new("Part")
- Decal3 = Instance.new("Decal")
- Tool0.Name = "Fidget"
- Tool0.Parent = mas
- Script1.Name = "WeldScript"
- Script1.Parent = Tool0
- table.insert(cors,sandbox(Script1,function()
- -- Simple Welding Script by Plugined. 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))
- Part2.Name = "Handle"
- Part2.Parent = Tool0
- Part2.Size = Vector3.new(4, 4.85000086, 0.0500000007)
- Part2.CFrame = CFrame.new(-20.6899986, 2.42500424, -25.3449955, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part2.BottomSurface = Enum.SurfaceType.Smooth
- Part2.TopSurface = Enum.SurfaceType.Smooth
- Part2.Position = Vector3.new(-20.6899986, 2.42500424, -25.3449955)
- Decal3.Parent = Part2
- Decal3.Texture = "http://www.roblox.com/asset/?id=875084006"
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = game:GetService("Players").LocalPlayer.Backpack
- 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