Hebablazin

Troll

May 31st, 2016
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.01 KB | None | 0 0
  1. --Troll Gifted by machontz, Regular Script!
  2.  
  3. Surfaces = {"FrontSurface", "BackSurface", "TopSurface", "BottomSurface", "LeftSurface", "RightSurface"}
  4.  
  5. function Part(Parent, Anchor, Collide, Tran, Ref, Color, X, Y, Z, Break)
  6.  
  7. local p = Instance.new("Part")
  8.  
  9. p.formFactor = "Custom"
  10.  
  11. p.Anchored = Anchor
  12.  
  13. p.CanCollide = Collide
  14.  
  15. p.Transparency = Tran
  16.  
  17. p.Reflectance = Ref
  18.  
  19. p.BrickColor = BrickColor.new(Color)
  20.  
  21. for _, Surf in pairs(Surfaces) do
  22.  
  23. p[Surf] = "Smooth"
  24.  
  25. end
  26.  
  27. p.Size = Vector3.new(X, Y, Z)
  28.  
  29. if Break then
  30.  
  31. p:BreakJoints()
  32.  
  33. else p:MakeJoints() end
  34.  
  35. p.Parent = Parent
  36.  
  37. return p
  38.  
  39. end
  40.  
  41.  
  42.  
  43. function Weld(p0, p1, x, y, z, a, b, c)
  44.  
  45. local w = Instance.new("Weld")
  46.  
  47. w.Parent = p0
  48.  
  49. w.Part0 = p0
  50.  
  51. w.Part1 = p1
  52.  
  53. w.C0 = CFrame.new(x,y,z) * CFrame.Angles(a,b,c)
  54.  
  55. return w
  56.  
  57. end
  58.  
  59.  
  60.  
  61. function getcf(pos1, pos2)
  62.  
  63. local pos3 = Vector3.new(pos2.X, pos1.Y, pos2.Z)
  64.  
  65. return CFrame.new(pos1, pos3)
  66.  
  67. end
  68.  
  69.  
  70.  
  71. function findjelly(pos)
  72.  
  73. local t
  74.  
  75. local d = math.huge
  76.  
  77. local h
  78.  
  79. local tors
  80.  
  81. for i,v in pairs(workspace:children()) do
  82.  
  83. t, h = v:findFirstChild("Torso"), v:findFirstChild("Humanoid")
  84.  
  85. if t ~= nil and h ~= nil then
  86.  
  87. if (t.Position - pos).magnitude < d and h.Health > 0 then
  88.  
  89. d = (t.Position - pos).magnitude
  90.  
  91. tors = t
  92.  
  93. end
  94.  
  95. end
  96.  
  97. end
  98.  
  99. return tors
  100.  
  101. end
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109. function maketroll(pos)
  110.  
  111. local model = Instance.new("Model")
  112.  
  113. model.Name = "TROLLLLLLZ"
  114.  
  115. local body = Part(model, false, true, 0, 0, "Really black", 1.3, 4.5, 1.3, true)
  116.  
  117. local bg = Instance.new("BodyGyro",body)
  118.  
  119. bg.P = 6000
  120.  
  121. bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  122.  
  123. local bv = Instance.new("BodyVelocity",body)
  124.  
  125. bv.P = 6000
  126.  
  127. bv.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  128.  
  129. bv.velocity = Vector3.new(0,0,0)
  130.  
  131. Instance.new("CylinderMesh",body)
  132.  
  133. local head = Part(model, false, true, 1, 0, "Really black", 3.5, 3.2, 0.4, true)
  134.  
  135. local neck = Weld(body, head, 0, 2.25+1.35, 0, 0, 0, 0)
  136.  
  137. local fr = Instance.new("Decal",head)
  138.  
  139. fr.Face = "Front"
  140.  
  141. fr.Texture = "http://www.roblox.com/asset/?id=29658197"
  142.  
  143. local ba = Instance.new("Decal",head)
  144.  
  145. ba.Face = "Back"
  146.  
  147. ba.Texture = "http://www.roblox.com/asset/?id=29658197"
  148.  
  149.  
  150.  
  151. local Ramodel = Instance.new("Model",model)
  152.  
  153. local rarm = Part(Ramodel, false, true, 0, 0, "Really black", 0.9, 0.7, 0.9, true)
  154.  
  155. Instance.new("CylinderMesh",rarm)
  156.  
  157. local rb = Part(model, false, true, 1, 0, "Really black", 0.1, 0.1, 0.1, true)
  158.  
  159. local rah = Weld(body, rb, 1, 1.8, 0, 0, 0, 0)
  160.  
  161. local rw = Weld(rb, rarm, 0, 0, 0, 0, 0, math.pi/2.8)
  162.  
  163.  
  164.  
  165. for i=0, -70, -10 do
  166.  
  167. local rarm2 = Part(Ramodel, false, true, 0, 0, "Really black", 0.9, 0.7, 0.9, true)
  168.  
  169. Instance.new("CylinderMesh",rarm2)
  170.  
  171. local w = Weld(rarm, rarm2, -3, 0, 0, 0, 0, math.rad(i))
  172.  
  173. w.C1 = CFrame.new(-3,0,0)
  174.  
  175. end
  176.  
  177.  
  178.  
  179. local Lamodel = Instance.new("Model",model)
  180.  
  181. local larm = Part(Lamodel, false, true, 0, 0, "Really black", 0.9, 0.7, 0.9, true)
  182.  
  183. Instance.new("CylinderMesh",larm)
  184.  
  185. local lb = Part(model, false, true, 1, 0, "Really black", 0.1, 0.1, 0.1, true)
  186.  
  187. local lah = Weld(body, lb, -1, 1.8, 0, 0, 0, 0)
  188.  
  189. local lw = Weld(lb, larm, 0, 0, 0, 0, math.pi, math.pi/2.8)
  190.  
  191.  
  192.  
  193. for i=0, -70, -10 do
  194.  
  195. local larm2 = Part(Lamodel, false, true, 0, 0, "Really black", 0.9, 0.7, 0.9, true)
  196.  
  197. Instance.new("CylinderMesh",larm2)
  198.  
  199. local w = Weld(larm, larm2, -3, 0, 0, 0, 0, math.rad(i))
  200.  
  201. w.C1 = CFrame.new(-3,0,0)
  202.  
  203. end
  204.  
  205.  
  206.  
  207. local Rlmodel = Instance.new("Model",model)
  208.  
  209. local rleg = Part(Rlmodel, false, true, 0, 0, "Really black", 0.9, 0.7, 0.9, true)
  210.  
  211. Instance.new("CylinderMesh",rleg)
  212.  
  213. local rlb = Part(model, false, true, 1, 0, "Really black", 0.1, 0.1, 0.1, true)
  214.  
  215. local rlh = Weld(body, rlb, 0, -1.9, 0, 0, 0, 0)
  216.  
  217. local rlw = Weld(rlb, rleg, 0, 0, 0, 0, 0, math.pi/2.8)
  218.  
  219.  
  220.  
  221. for i=0, -70, -10 do
  222.  
  223. local rleg2 = Part(Rlmodel, false, true, 0, 0, "Really black", 0.9, 0.7, 0.9, true)
  224.  
  225. Instance.new("CylinderMesh",rleg2)
  226.  
  227. local w = Weld(rleg, rleg2, -3, 0, 0, 0, 0, math.rad(i))
  228.  
  229. w.C1 = CFrame.new(-3,0,0)
  230.  
  231. end
  232.  
  233.  
  234.  
  235. local Llmodel = Instance.new("Model",model)
  236.  
  237. local lleg = Part(Llmodel, false, true, 0, 0, "Really black", 0.9, 0.7, 0.9, true)
  238.  
  239. Instance.new("CylinderMesh",lleg)
  240.  
  241. local llb = Part(model, false, true, 1, 0, "Really black", 0.1, 0.1, 0.1, true)
  242.  
  243. local llh = Weld(body, llb, 0, -1.9, 0, 0, 0, 0)
  244.  
  245. local llw = Weld(llb, lleg, 0, 0, 0, 0, math.pi, math.pi/2.8)
  246.  
  247.  
  248.  
  249. for i=0, -70, -10 do
  250.  
  251. local lleg2 = Part(Llmodel, false, true, 0, 0, "Really black", 0.9, 0.7, 0.9, true)
  252.  
  253. Instance.new("CylinderMesh",lleg2)
  254.  
  255. local w = Weld(lleg, lleg2, -3, 0, 0, 0, 0, math.rad(i))
  256.  
  257. w.C1 = CFrame.new(-3,0,0)
  258.  
  259. end
  260.  
  261. model.Parent = workspace
  262.  
  263. model:MakeJoints()
  264.  
  265. model:MoveTo(pos)
  266.  
  267. coroutine.resume(coroutine.create(function()
  268.  
  269. while true do
  270.  
  271. wait()
  272.  
  273. if body.Velocity.magnitude > 2 then
  274.  
  275. coroutine.resume(coroutine.create(function()
  276.  
  277. for i=0,40,5 do
  278.  
  279. rw.C1 = CFrame.Angles(math.rad(i),0,0)
  280.  
  281. lw.C1 = CFrame.Angles(math.rad(i),0,0)
  282.  
  283. llw.C1 = CFrame.Angles(math.rad(-i),0,0)
  284.  
  285. rlw.C1 = CFrame.Angles(math.rad(-i),0,0)
  286.  
  287. wait()
  288.  
  289. end
  290.  
  291. for i=40,-40,-5 do
  292.  
  293. rw.C1 = CFrame.Angles(math.rad(i),0,0)
  294.  
  295. lw.C1 = CFrame.Angles(math.rad(i),0,0)
  296.  
  297. llw.C1 = CFrame.Angles(math.rad(-i),0,0)
  298.  
  299. rlw.C1 = CFrame.Angles(math.rad(-i),0,0)
  300.  
  301. wait()
  302.  
  303. end
  304.  
  305. for i=-40,0,5 do
  306.  
  307. rw.C1 = CFrame.Angles(math.rad(i),0,0)
  308.  
  309. lw.C1 = CFrame.Angles(math.rad(i),0,0)
  310.  
  311. llw.C1 = CFrame.Angles(math.rad(-i),0,0)
  312.  
  313. rlw.C1 = CFrame.Angles(math.rad(-i),0,0)
  314.  
  315. wait()
  316.  
  317. end
  318.  
  319. end))
  320.  
  321. end
  322.  
  323. local jelly = findjelly(body.Position)
  324.  
  325. if jelly ~= nil then
  326.  
  327. bg.cframe = getcf(body.Position, jelly.Position)
  328.  
  329. bv.velocity = bg.cframe.lookVector * 25
  330.  
  331. else
  332.  
  333. bv.velocity = Vector3.new(0,0,0)
  334.  
  335. end
  336.  
  337. end
  338.  
  339. end))
  340.  
  341. end
  342.  
  343.  
  344.  
  345. maketroll(Vector3.new(0,5,0))
Add Comment
Please, Sign In to add comment