PacMan2009yo

TROLLS ROBLOX

May 3rd, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.63 KB | None | 0 0
  1. Surfaces = {"FrontSurface", "BackSurface", "TopSurface", "BottomSurface", "LeftSurface", "RightSurface"}
  2. function Part(Parent, Anchor, Collide, Tran, Ref, Color, X, Y, Z, Break)
  3. local p = Instance.new("Part")
  4. p.formFactor = "Custom"
  5. p.Anchored = Anchor
  6. p.CanCollide = Collide
  7. p.Transparency = Tran
  8. p.Reflectance = Ref
  9. p.BrickColor = BrickColor.new(Color)
  10. for _, Surf in pairs(Surfaces) do
  11. p[Surf] = "Smooth"
  12. end
  13. p.Size = Vector3.new(X, Y, Z)
  14. if Break then
  15. p:BreakJoints()
  16. else p:MakeJoints() end
  17. p.Parent = Parent
  18. return p
  19. end
  20.  
  21. function Weld(p0, p1, x, y, z, a, b, c)
  22. local w = Instance.new("Weld")
  23. w.Parent = p0
  24. w.Part0 = p0
  25. w.Part1 = p1
  26. w.C0 = CFrame.new(x,y,z) * CFrame.Angles(a,b,c)
  27. return w
  28. end
  29.  
  30. function getcf(pos1, pos2)
  31. local pos3 = Vector3.new(pos2.X, pos1.Y, pos2.Z)
  32. return CFrame.new(pos1, pos3)
  33. end
  34.  
  35. function findjelly(pos)
  36. local t
  37. local d = math.huge
  38. local h
  39. local tors
  40. for i,v in pairs(workspace:children()) do
  41. t, h = v:findFirstChild("Torso"), v:findFirstChild("Humanoid")
  42. if t ~= nil and h ~= nil then
  43. if (t.Position - pos).magnitude < d and h.Health > 0 then
  44. d = (t.Position - pos).magnitude
  45. tors = t
  46. end
  47. end
  48. end
  49. return tors
  50. end
  51.  
  52.  
  53.  
  54. function maketroll(pos)
  55. local model = Instance.new("Model")
  56. model.Name = "TROLLLLLLZ"
  57. local body = Part(model, false, true, 0, 0, "Really black", 1.3, 4.5, 1.3, true)
  58. local bg = Instance.new("BodyGyro",body)
  59. bg.P = 6000
  60. bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  61. local bv = Instance.new("BodyVelocity",body)
  62. bv.P = 6000
  63. bv.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  64. bv.velocity = Vector3.new(0,0,0)
  65. Instance.new("CylinderMesh",body)
  66. local head = Part(model, false, true, 1, 0, "Really black", 3.5, 3.2, 0.4, true)
  67. local neck = Weld(body, head, 0, 2.25+1.35, 0, 0, 0, 0)
  68. local fr = Instance.new("Decal",head)
  69. fr.Face = "Front"
  70. fr.Texture = "http://www.roblox.com/asset/?id=29658197"
  71. local ba = Instance.new("Decal",head)
  72. ba.Face = "Back"
  73. ba.Texture = "http://www.roblox.com/asset/?id=29658197"
  74.  
  75. local Ramodel = Instance.new("Model",model)
  76. local rarm = Part(Ramodel, false, true, 0, 0, "Really black", 0.9, 0.7, 0.9, true)
  77. Instance.new("CylinderMesh",rarm)
  78. local rb = Part(model, false, true, 1, 0, "Really black", 0.1, 0.1, 0.1, true)
  79. local rah = Weld(body, rb, 1, 1.8, 0, 0, 0, 0)
  80. local rw = Weld(rb, rarm, 0, 0, 0, 0, 0, math.pi/2.8)
  81.  
  82. for i=0, -70, -10 do
  83. local rarm2 = Part(Ramodel, false, true, 0, 0, "Really black", 0.9, 0.7, 0.9, true)
  84. Instance.new("CylinderMesh",rarm2)
  85. local w = Weld(rarm, rarm2, -3, 0, 0, 0, 0, math.rad(i))
  86. w.C1 = CFrame.new(-3,0,0)
  87. end
  88.  
  89. local Lamodel = Instance.new("Model",model)
  90. local larm = Part(Lamodel, false, true, 0, 0, "Really black", 0.9, 0.7, 0.9, true)
  91. Instance.new("CylinderMesh",larm)
  92. local lb = Part(model, false, true, 1, 0, "Really black", 0.1, 0.1, 0.1, true)
  93. local lah = Weld(body, lb, -1, 1.8, 0, 0, 0, 0)
  94. local lw = Weld(lb, larm, 0, 0, 0, 0, math.pi, math.pi/2.8)
  95.  
  96. for i=0, -70, -10 do
  97. local larm2 = Part(Lamodel, false, true, 0, 0, "Really black", 0.9, 0.7, 0.9, true)
  98. Instance.new("CylinderMesh",larm2)
  99. local w = Weld(larm, larm2, -3, 0, 0, 0, 0, math.rad(i))
  100. w.C1 = CFrame.new(-3,0,0)
  101. end
  102.  
  103. local Rlmodel = Instance.new("Model",model)
  104. local rleg = Part(Rlmodel, false, true, 0, 0, "Really black", 0.9, 0.7, 0.9, true)
  105. Instance.new("CylinderMesh",rleg)
  106. local rlb = Part(model, false, true, 1, 0, "Really black", 0.1, 0.1, 0.1, true)
  107. local rlh = Weld(body, rlb, 0, -1.9, 0, 0, 0, 0)
  108. local rlw = Weld(rlb, rleg, 0, 0, 0, 0, 0, math.pi/2.8)
  109.  
  110. for i=0, -70, -10 do
  111. local rleg2 = Part(Rlmodel, false, true, 0, 0, "Really black", 0.9, 0.7, 0.9, true)
  112. Instance.new("CylinderMesh",rleg2)
  113. local w = Weld(rleg, rleg2, -3, 0, 0, 0, 0, math.rad(i))
  114. w.C1 = CFrame.new(-3,0,0)
  115. end
  116.  
  117. local Llmodel = Instance.new("Model",model)
  118. local lleg = Part(Llmodel, false, true, 0, 0, "Really black", 0.9, 0.7, 0.9, true)
  119. Instance.new("CylinderMesh",lleg)
  120. local llb = Part(model, false, true, 1, 0, "Really black", 0.1, 0.1, 0.1, true)
  121. local llh = Weld(body, llb, 0, -1.9, 0, 0, 0, 0)
  122. local llw = Weld(llb, lleg, 0, 0, 0, 0, math.pi, math.pi/2.8)
  123.  
  124. for i=0, -70, -10 do
  125. local lleg2 = Part(Llmodel, false, true, 0, 0, "Really black", 0.9, 0.7, 0.9, true)
  126. Instance.new("CylinderMesh",lleg2)
  127. local w = Weld(lleg, lleg2, -3, 0, 0, 0, 0, math.rad(i))
  128. w.C1 = CFrame.new(-3,0,0)
  129. end
  130. model.Parent = workspace
  131. model:MakeJoints()
  132. model:MoveTo(pos)
  133. coroutine.resume(coroutine.create(function()
  134. while true do
  135. wait()
  136. if body.Velocity.magnitude > 2 then
  137. coroutine.resume(coroutine.create(function()
  138. for i=0,40,5 do
  139. rw.C1 = CFrame.Angles(math.rad(i),0,0)
  140. lw.C1 = CFrame.Angles(math.rad(i),0,0)
  141. llw.C1 = CFrame.Angles(math.rad(-i),0,0)
  142. rlw.C1 = CFrame.Angles(math.rad(-i),0,0)
  143. wait()
  144. end
  145. for i=40,-40,-5 do
  146. rw.C1 = CFrame.Angles(math.rad(i),0,0)
  147. lw.C1 = CFrame.Angles(math.rad(i),0,0)
  148. llw.C1 = CFrame.Angles(math.rad(-i),0,0)
  149. rlw.C1 = CFrame.Angles(math.rad(-i),0,0)
  150. wait()
  151. end
  152. for i=-40,0,5 do
  153. rw.C1 = CFrame.Angles(math.rad(i),0,0)
  154. lw.C1 = CFrame.Angles(math.rad(i),0,0)
  155. llw.C1 = CFrame.Angles(math.rad(-i),0,0)
  156. rlw.C1 = CFrame.Angles(math.rad(-i),0,0)
  157. wait()
  158. end
  159. end))
  160. end
  161. local jelly = findjelly(body.Position)
  162. if jelly ~= nil then
  163. bg.cframe = getcf(body.Position, jelly.Position)
  164. bv.velocity = bg.cframe.lookVector * 25
  165. else
  166. bv.velocity = Vector3.new(0,0,0)
  167. end
  168. end
  169. end))
  170. end
  171.  
  172. maketroll(Vector3.new(0,5,0))
Add Comment
Please, Sign In to add comment