Advertisement
Plug_RBLX

test

Dec 29th, 2017
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.25 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. SpecialMesh2 = Instance.new("SpecialMesh")
  20. Sound3 = Instance.new("Sound")
  21. Script4 = Instance.new("Script")
  22. Tool0.Name = "Bawmbuzx"
  23. Tool0.Parent = mas
  24. Part1.Name = "Handle"
  25. Part1.Parent = Tool0
  26. Part1.Size = Vector3.new(4, 1, 2)
  27. Part1.CFrame = CFrame.new(32.3099976, 0.500003994, -21.2999992, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  28. Part1.BottomSurface = Enum.SurfaceType.Smooth
  29. Part1.TopSurface = Enum.SurfaceType.Smooth
  30. Part1.Position = Vector3.new(32.3099976, 0.500003994, -21.2999992)
  31. SpecialMesh2.Parent = Part1
  32. SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=151760030"
  33. SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=151760072"
  34. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  35. Sound3.Parent = Part1
  36. Sound3.Pitch = 1.1499999761581
  37. Sound3.SoundId = "rbxassetid://366816774"
  38. Sound3.Volume = 5
  39. Sound3.Looped = true
  40. Script4.Name = "LocalWeldScript"
  41. Script4.Parent = Tool0
  42. table.insert(cors,sandbox(Script4,function()
  43. -- Simple Welding Script by Fusion_Swarly. No credit necessary.
  44.  
  45. --[[
  46. 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
  47. 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.
  48.  
  49. 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.
  50.  
  51. If you want to remove all welds from your model, Just set removeWelds to true. (If you ever used the qPerfectionWeld script, This will
  52. also remove all those annoying CFrame values as well.)
  53. --]]
  54.  
  55. unanchor = false
  56.  
  57. removeWelds = false
  58.  
  59. classes = {
  60. "Part";
  61. "WedgePart";
  62. "TrussPart";
  63. "CornerWedgePart";
  64. "Seat";
  65. "VehicleSeat";
  66. "UnionOperation";
  67. "NegateOperation";
  68. "MeshPart";
  69. "SpawnLocation";
  70. }
  71.  
  72. -- Don't edit anything down here unless you know what you're doing.
  73.  
  74. function createWeld(p1, p2)
  75. local weld = Instance.new("Weld", p1)
  76. weld.C0 = p1.CFrame:inverse() * p2.CFrame
  77. weld.Part0 = p1
  78. weld.Part1 = p2
  79. end
  80.  
  81. function checkWelds(model)
  82. local prev
  83. local c = model:GetChildren()
  84. for i = 1, #c do
  85. for a = 1, #classes do
  86. if c[i].ClassName == classes[a] then
  87. local oldWeld = c[i]:FindFirstChildOfClass("Weld")
  88. if oldWeld ~= nil then
  89. oldWeld:Destroy()
  90. end
  91. local oldCFrame = c[i]:FindFirstChildOfClass("CFrameValue")
  92. if oldCFrame ~= nil then
  93. oldCFrame:Destroy()
  94. end
  95. if removeWelds == false then
  96. if unanchor == true then
  97. c[i].Anchored = false
  98. end
  99. if prev ~= nil then
  100. createWeld(prev, c[i])
  101. end
  102. prev = c[i]
  103. end
  104. end
  105. end
  106. checkWelds(c[i])
  107. end
  108. end
  109.  
  110. checkWelds(script.Parent)
  111. end))
  112. for i,v in pairs(mas:GetChildren()) do
  113. v.Parent = script
  114. pcall(function() v:MakeJoints() end)
  115. end
  116. mas:Destroy()
  117. for i,v in pairs(cors) do
  118. spawn(function()
  119. pcall(v)
  120. end)
  121. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement