Advertisement
Plug_RBLX

robawxk

Dec 30th, 2017
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.62 KB | None | 0 0
  1. function sandbox(var,func)
  2. local env = getfenv(func)
  3. local newenv = setmetatable({},{
  4. __index = function(self,k)
  5. if k=="script" then
  6. return var
  7. else
  8. return env[k]
  9. end
  10. end,
  11. })
  12. setfenv(func,newenv)
  13. return func
  14. end
  15. cors = {}
  16. mas = Instance.new("Model",game:GetService("Lighting"))
  17. Tool0 = Instance.new("Tool")
  18. Part1 = Instance.new("Part")
  19. Decal2 = Instance.new("Decal")
  20. Decal3 = Instance.new("Decal")
  21. Script4 = Instance.new("Script")
  22. Tool0.Name = "Robux"
  23. Tool0.Parent = mas
  24. Part1.Name = "Handle"
  25. Part1.Parent = Tool0
  26. Part1.BrickColor = BrickColor.new("Dark green")
  27. Part1.Rotation = Vector3.new(-179.949997, -23.289999, -179.979996)
  28. Part1.CanCollide = false
  29. Part1.FormFactor = Enum.FormFactor.Plate
  30. Part1.Size = Vector3.new(2, 0.400000006, 1)
  31. Part1.CFrame = CFrame.new(-18.9216633, 0.200430006, -20.088274, -0.918547034, 0.000314582547, -0.395311654, -1.49886588e-07, 0.999999642, 0.000796131673, 0.395311743, 0.000731343694, -0.918546796)
  32. Part1.BottomSurface = Enum.SurfaceType.Smooth
  33. Part1.TopSurface = Enum.SurfaceType.Smooth
  34. Part1.Color = Color3.new(0.156863, 0.498039, 0.278431)
  35. Part1.Position = Vector3.new(-18.9216633, 0.200430006, -20.088274)
  36. Part1.Orientation = Vector3.new(-0.049999997, -156.709991, 0)
  37. Part1.Color = Color3.new(0.156863, 0.498039, 0.278431)
  38. Decal2.Parent = Part1
  39. Decal2.Texture = "http://www.roblox.com/asset/?id=8057772"
  40. Decal2.Face = Enum.NormalId.Bottom
  41. Decal3.Parent = Part1
  42. Decal3.Texture = "http://www.roblox.com/asset/?id=8057772"
  43. Decal3.Face = Enum.NormalId.Top
  44. Script4.Name = "WeldScript"
  45. Script4.Parent = Tool0
  46. table.insert(cors,sandbox(Script4,function()
  47. -- Simple Welding Script by Plugined. No credit necessary.
  48.  
  49. --[[
  50. 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
  51. 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.
  52.  
  53. 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.
  54.  
  55. If you want to remove all welds from your model, Just set removeWelds to true. (If you ever used the qPerfectionWeld script, This will
  56. also remove all those annoying CFrame values as well.)
  57. --]]
  58.  
  59. unanchor = false
  60.  
  61. removeWelds = false
  62.  
  63. classes = {
  64. "Part";
  65. "WedgePart";
  66. "TrussPart";
  67. "CornerWedgePart";
  68. "Seat";
  69. "VehicleSeat";
  70. "UnionOperation";
  71. "NegateOperation";
  72. "MeshPart";
  73. "SpawnLocation";
  74. }
  75.  
  76. -- Don't edit anything down here unless you know what you're doing.
  77.  
  78. function createWeld(p1, p2)
  79. local weld = Instance.new("Weld", p1)
  80. weld.C0 = p1.CFrame:inverse() * p2.CFrame
  81. weld.Part0 = p1
  82. weld.Part1 = p2
  83. end
  84.  
  85. function checkWelds(model)
  86. local prev
  87. local c = model:GetChildren()
  88. for i = 1, #c do
  89. for a = 1, #classes do
  90. if c[i].ClassName == classes[a] then
  91. local oldWeld = c[i]:FindFirstChildOfClass("Weld")
  92. if oldWeld ~= nil then
  93. oldWeld:Destroy()
  94. end
  95. local oldCFrame = c[i]:FindFirstChildOfClass("CFrameValue")
  96. if oldCFrame ~= nil then
  97. oldCFrame:Destroy()
  98. end
  99. if removeWelds == false then
  100. if unanchor == true then
  101. c[i].Anchored = false
  102. end
  103. if prev ~= nil then
  104. createWeld(prev, c[i])
  105. end
  106. prev = c[i]
  107. end
  108. end
  109. end
  110. checkWelds(c[i])
  111. end
  112. end
  113.  
  114. checkWelds(script.Parent)
  115. end))
  116. for i,v in pairs(mas:GetChildren()) do
  117. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  118. pcall(function() v:MakeJoints() end)
  119. end
  120. mas:Destroy()
  121. for i,v in pairs(cors) do
  122. spawn(function()
  123. pcall(v)
  124. end)
  125. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement