Advertisement
DrakerMaker

Small

Nov 2nd, 2019
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.24 KB | None | 0 0
  1. function scaleCharacter(model,scale)
  2. if not model or not scale then return end
  3. if not _G.ScaleCons then
  4. _G.ScaleCons = {}
  5. end
  6. if _G.ScaleCons[model] then
  7. _G.ScaleCons[model]:disconnect()
  8. end
  9. local joints = {}
  10. local parts = {}
  11. local h = model:findFirstChild("Humanoid")
  12. if h then
  13. h.Parent = nil
  14. end
  15. local function handleHat(hat)
  16. if hat:findFirstChild("GotScaled") then return end
  17. Instance.new("Flag",hat).Name = "GotScaled"
  18. Spawn(function ()
  19. local h = hat:WaitForChild("Handle")
  20. local m = h:WaitForChild("Mesh")
  21. m.Scale = m.Scale * scale
  22. end)
  23. local yInc = (scale-1)*.5
  24. hat.AttachmentPos = (hat.AttachmentPos * scale) - (hat.AttachmentUp * Vector3.new(yInc,yInc,yInc))
  25. end
  26. for _,v in pairs(model:GetChildren()) do
  27. if v:IsA("BasePart") then
  28. table.insert(parts,v)
  29. v.Anchored = true;
  30. v.FormFactor = "Custom";
  31. for _,j in pairs(v:GetChildren()) do
  32. if j:IsA("Motor6D") then
  33. local t = {
  34. Name = j.Name;
  35. Parent = v;
  36. Part0 = j.Part0;
  37. Part1 = j.Part1;
  38. C0 = j.C0;
  39. C1 = j.C1;
  40. }
  41. table.insert(joints,t)
  42. j:Destroy()
  43. end
  44. end
  45. elseif v:IsA("Hat") then
  46. handleHat(v)
  47. end
  48. end
  49. for _,v in pairs(parts) do
  50. v.Size = v.Size * scale
  51. v.Anchored = false
  52. end
  53. for _,j in pairs(joints) do
  54. local c0 = {j.C0:components()}
  55. local c1 = {j.C1:components()}
  56. for i = 1,3 do
  57. c0[i] = c0[i] * scale
  58. c1[i] = c1[i] * scale
  59. end
  60. j.C0 = CFrame.new(unpack(c0))
  61. j.C1 = CFrame.new(unpack(c1))
  62. local n = Instance.new("Motor6D")
  63. for k,v in pairs(j) do
  64. n[k] = v
  65. end
  66. end
  67. model.ChildAdded:connect(function (c)
  68. if c:IsA("Hat") then
  69. handleHat(c)
  70. end
  71. end)
  72. if h then
  73. h.Parent = model
  74. h.WalkSpeed = 12
  75. h.JumpPower = 42
  76. h.MaxHealth = 100 * scale
  77. h.Health = (h.Health/h.MaxHealth)*(100*scale)
  78. end
  79. _G.ScaleCons[model] = con
  80. end
  81. scaleCharacter(owner.Character, 0.3)
  82. -- Thanks for using Mod2S by NopeUsername
  83. local functions = {}
  84. function sandbox(script, func)
  85. local oldEnv = getfenv(func)
  86.  
  87. local newEnv = setmetatable({}, {
  88. __index = function(self,k)
  89. if k == "script" then
  90. return script
  91. else
  92. return oldEnv[k]
  93. end
  94. end,
  95. })
  96.  
  97. return setfenv(func, newEnv)
  98. end
  99.  
  100. -- Thanks for using Mod2S by NopeUsername
  101. local functions = {}
  102. function sandbox(script, func)
  103. local oldEnv = getfenv(func)
  104.  
  105. local newEnv = setmetatable({}, {
  106. __index = function(self,k)
  107. if k == "script" then
  108. return script
  109. else
  110. return oldEnv[k]
  111. end
  112. end,
  113. })
  114.  
  115. return setfenv(func, newEnv)
  116. end
  117.  
  118. local mas = Instance.new("Model", game:GetService("Lighting"))
  119. -- DECLARING VARIABLES
  120.  
  121. local Model = Instance.new("Model")
  122. local Part = Instance.new("Part")
  123. local Part_1 = Instance.new("Part")
  124. local Part_2 = Instance.new("Part")
  125. local Part_3 = Instance.new("Part")
  126. local Part_4 = Instance.new("Part")
  127. local Part_5 = Instance.new("Part")
  128. local Part_6 = Instance.new("Part")
  129. local Part_7 = Instance.new("Part")
  130. local Decal = Instance.new("Decal")
  131. local Seat = Instance.new("Seat")
  132.  
  133. -- SETTING PROPERTIES
  134.  
  135. Model.Parent = mas
  136.  
  137. Part.BottomSurface = Enum.SurfaceType.Smooth
  138. Part.CFrame = CFrame.new(0.079,2.135,-1.986,1,0,0,0,1,0,0,0,1)
  139. Part.Color = Color3.new(1,0.349,0.349)
  140. Part.Material = Enum.Material.Brick
  141. Part.Size = Vector3.new(2.287,3.586,0.335)
  142. Part.TopSurface = Enum.SurfaceType.Smooth
  143. Part.Parent = Model
  144.  
  145. Part_1.BottomSurface = Enum.SurfaceType.Smooth
  146. Part_1.CFrame = CFrame.new(-2.131,3.431,-1.986,1,0,0,0,1,0,0,0,1)
  147. Part_1.Color = Color3.new(1,0.349,0.349)
  148. Part_1.Material = Enum.Material.Brick
  149. Part_1.Size = Vector3.new(2.14,0.995,0.335)
  150. Part_1.TopSurface = Enum.SurfaceType.Smooth
  151. Part_1.Parent = Model
  152.  
  153. Part_2.BottomSurface = Enum.SurfaceType.Smooth
  154. Part_2.CFrame = CFrame.new(1.335,2.135,-4.54,1,0,0,0,1,0,0,0,1)
  155. Part_2.Color = Color3.new(1,0.349,0.349)
  156. Part_2.Material = Enum.Material.Brick
  157. Part_2.Size = Vector3.new(0.226,3.586,5.443)
  158. Part_2.TopSurface = Enum.SurfaceType.Smooth
  159. Part_2.Parent = Model
  160.  
  161. Part_3.BottomSurface = Enum.SurfaceType.Smooth
  162. Part_3.CFrame = CFrame.new(-0.99,2.135,-7.048,1,0,0,0,1,0,0,0,1)
  163. Part_3.Color = Color3.new(1,0.349,0.349)
  164. Part_3.Material = Enum.Material.Brick
  165. Part_3.Size = Vector3.new(4.875,3.586,0.427)
  166. Part_3.TopSurface = Enum.SurfaceType.Smooth
  167. Part_3.Parent = Model
  168.  
  169. Part_4.BottomSurface = Enum.SurfaceType.Smooth
  170. Part_4.CFrame = CFrame.new(-1.008,0.171,-4.54,1,0,0,0,1,0,0,0,1)
  171. Part_4.Color = Color3.new(0.627,0.373,0.208)
  172. Part_4.Material = Enum.Material.WoodPlanks
  173. Part_4.Size = Vector3.new(4.868,0.342,5.443)
  174. Part_4.TopSurface = Enum.SurfaceType.Smooth
  175. Part_4.Parent = Model
  176.  
  177. Part_5.BottomSurface = Enum.SurfaceType.Smooth
  178. Part_5.CFrame = CFrame.new(-3.33,2.135,-4.54,1,0,0,0,1,0,0,0,1)
  179. Part_5.Color = Color3.new(1,0.349,0.349)
  180. Part_5.Material = Enum.Material.Brick
  181. Part_5.Size = Vector3.new(0.226,3.586,5.443)
  182. Part_5.TopSurface = Enum.SurfaceType.Smooth
  183. Part_5.Parent = Model
  184.  
  185. Part_6.BottomSurface = Enum.SurfaceType.Smooth
  186. Part_6.CFrame = CFrame.new(-1.008,4.099,-4.54,1,0,0,0,1,0,0,0,1)
  187. Part_6.Color = Color3.new(0.627,0.373,0.208)
  188. Part_6.Material = Enum.Material.WoodPlanks
  189. Part_6.Size = Vector3.new(4.868,0.342,5.443)
  190. Part_6.TopSurface = Enum.SurfaceType.Smooth
  191. Part_6.Parent = Model
  192.  
  193. Part_7.BottomSurface = Enum.SurfaceType.Smooth
  194. Part_7.CFrame = CFrame.new(-1.025,2.678,-6.833,1,0,0,0,1,0,0,0,1)
  195. Part_7.Color = Color3.new(0.067,0.067,0.067)
  196. Part_7.Material = Enum.Material.SmoothPlastic
  197. Part_7.Size = Vector3.new(4,2.01,0.13)
  198. Part_7.TopSurface = Enum.SurfaceType.Smooth
  199. Part_7.Parent = Model
  200.  
  201. Decal.Texture = "http://www.roblox.com/asset/?id=1146819419"
  202. Decal.Face = Enum.NormalId.Back
  203. Decal.Parent = Part_7
  204.  
  205. Seat.BottomSurface = Enum.SurfaceType.Smooth
  206. Seat.CFrame = CFrame.new(-1.039,0.5,-4.847,1,0,0,0,1,0,0,0,1)
  207. Seat.Color = Color3.new(0.106,0.165,0.208)
  208. Seat.Material = Enum.Material.Fabric
  209. Seat.Size = Vector3.new(1.07,1,1.28)
  210. Seat.TopSurface = Enum.SurfaceType.Smooth
  211. Seat.Parent = Model
  212.  
  213. Model.Parent = owner.Character.Humanoid
  214.  
  215. for i,v in ipairs(functions) do
  216. spawn(function()
  217. pcall(v)
  218. end)
  219. end
  220. for i,v in ipairs(mas:GetChildren()) do
  221. v.Parent = workspace
  222. end
  223. mas:Destroy()
  224.  
  225. for i,v in ipairs(Model:GetChildren()) do
  226. v.Locked = true
  227. v.Anchored = true
  228. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement