lol375090

hgj

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