replic8

Untitled

May 27th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.67 KB | None | 0 0
  1. --[[ put your name where it says yourname this banana makes people trip -ulti55 ]]
  2. Plrs = game:GetService("Players")
  3.  
  4. me = Plrs.dylanroxrox2
  5.  
  6. char = me.Character
  7.  
  8. Modelname = "xBananaz"
  9.  
  10. Toolname = "Banana"
  11.  
  12. Surfaces = {"FrontSurface", "BackSurface", "TopSurface", "BottomSurface", "LeftSurface", "RightSurface"}
  13.  
  14. necko = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  15.  
  16. selected = false
  17.  
  18. Able = true
  19.  
  20. Prop = {Damage = 30}
  21.  
  22.  
  23.  
  24. ToolIcon = ""
  25.  
  26. MouseIc = ""
  27.  
  28. MouseDo = ""
  29.  
  30.  
  31.  
  32. function Notime(func, tim)
  33.  
  34. coroutine.resume(coroutine.create(function()
  35.  
  36. if tim then
  37.  
  38. wait(tim)
  39.  
  40. end
  41.  
  42. func()
  43.  
  44. end))
  45.  
  46. end
  47.  
  48.  
  49.  
  50. Add = {
  51.  
  52. Sphere = function(P)
  53.  
  54. local m = Instance.new("SpecialMesh",P)
  55.  
  56. m.MeshType = "Sphere"
  57.  
  58. return m
  59.  
  60. end,
  61.  
  62. BF = function(P)
  63.  
  64. local bf = Instance.new("BodyForce",P)
  65.  
  66. bf.force = Vector3.new(0, P:GetMass()*187, 0)
  67.  
  68. return bf
  69.  
  70. end,
  71.  
  72. BP = function(P)
  73.  
  74. local bp = Instance.new("BodyPosition",P)
  75.  
  76. bp.maxForce = Vector3.new(math.huge, 0, math.huge)
  77.  
  78. bp.P = 14000
  79.  
  80. return bp
  81.  
  82. end,
  83.  
  84. BG = function(P)
  85.  
  86. local bg = Instance.new("BodyGyro",P)
  87.  
  88. bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  89.  
  90. bg.P = 14000
  91.  
  92. return bg
  93.  
  94. end,
  95.  
  96. Mesh = function(P, ID, x, y, z)
  97.  
  98. local m = Instance.new("SpecialMesh")
  99.  
  100. m.MeshId = ID
  101.  
  102. m.Scale = Vector3.new(x, y, z)
  103.  
  104. m.Parent = P
  105.  
  106. return m
  107.  
  108. end,
  109.  
  110. Sound = function(P, ID, vol, pitch)
  111.  
  112. local s = Instance.new("Sound")
  113.  
  114. s.SoundId = ID
  115.  
  116. s.Volume = vol
  117.  
  118. s.Pitch = pitch
  119.  
  120. s.Parent = P
  121.  
  122. return s
  123.  
  124. end
  125.  
  126. }
  127.  
  128.  
  129.  
  130. function find(tab, arg)
  131.  
  132. local ah = nil
  133.  
  134. for i,v in pairs(tab) do
  135.  
  136. if v == arg then
  137.  
  138. ah = v
  139.  
  140. end
  141.  
  142. end
  143.  
  144. return ah
  145.  
  146. end
  147.  
  148.  
  149.  
  150. function getAllParts(from)
  151.  
  152. local t = {}
  153.  
  154. function getParts(where)
  155.  
  156. for i, v in pairs(where:children()) do
  157.  
  158. if v:IsA("BasePart") then
  159.  
  160. if v.Parent ~= char and v.Parent.Parent ~= char then
  161.  
  162. table.insert(t, v)
  163.  
  164. end
  165.  
  166. end
  167.  
  168. getParts(v)
  169.  
  170. end
  171.  
  172. end
  173.  
  174. getParts(workspace)
  175.  
  176. return t
  177.  
  178. end
  179.  
  180.  
  181.  
  182. function RayCast(pos1, pos2, maxDist, forward)
  183.  
  184. local list = getAllParts(workspace)
  185.  
  186. local pos0 = pos1
  187.  
  188. for dist = 1, maxDist, forward do
  189.  
  190. pos0 = (CFrame.new(pos1, pos2) * CFrame.new(0, 0, -dist)).p
  191.  
  192. for _, v in pairs(list) do
  193.  
  194. local pos3 = v.CFrame:pointToObjectSpace(pos0)
  195.  
  196. local s = v.Size
  197.  
  198. if pos3.x > -(s.x/2) and pos3.x < (s.x/2) and pos3.y > -(s.y/2) and pos3.y < (s.y/2) and pos3.z > -(s.z/2) and pos3.x < (s.z/2) and v.CanCollide == true then
  199.  
  200. return pos0, v
  201.  
  202. end
  203.  
  204. end
  205.  
  206. end
  207.  
  208. return pos0, nil
  209.  
  210. end
  211.  
  212.  
  213.  
  214. function Part(Parent, Anchor, Collide, Tran, Ref, Color, X, Y, Z, Break)
  215.  
  216. local p = Instance.new("Part")
  217.  
  218. p.formFactor = "Custom"
  219.  
  220. p.Anchored = Anchor
  221.  
  222. p.CanCollide = Collide
  223.  
  224. p.Transparency = Tran
  225.  
  226. p.Reflectance = Ref
  227.  
  228. p.BrickColor = BrickColor.new(Color)
  229.  
  230. for _, Surf in pairs(Surfaces) do
  231.  
  232. p[Surf] = "Smooth"
  233.  
  234. end
  235.  
  236. p.Size = Vector3.new(X, Y, Z)
  237.  
  238. if Break then
  239.  
  240. p:BreakJoints()
  241.  
  242. else p:MakeJoints() end
  243.  
  244. p.Parent = Parent
  245.  
  246. return p
  247.  
  248. end
  249.  
  250.  
  251.  
  252. function Weld(p0, p1, x, y, z, a, b, c)
  253.  
  254. local w = Instance.new("Weld")
  255.  
  256. w.Parent = p0
  257.  
  258. w.Part0 = p0
  259.  
  260. w.Part1 = p1
  261.  
  262. w.C1 = CFrame.new(x,y,z) * CFrame.Angles(a,b,c)
  263.  
  264. return w
  265.  
  266. end
  267.  
  268.  
  269.  
  270. function ComputePos(pos1, pos2)
  271.  
  272. local pos3 = Vector3.new(pos2.x, pos1.y, pos2.z)
  273.  
  274. return CFrame.new(pos1, pos3)
  275.  
  276. end
  277.  
  278.  
  279.  
  280. function getHumanoid(c)
  281.  
  282. local h = nil
  283.  
  284. for i,v in pairs(c:children()) do
  285.  
  286. if v:IsA("Humanoid") then
  287.  
  288. if v.Health > 0 then
  289.  
  290. h = v
  291.  
  292. end
  293.  
  294. end
  295.  
  296. end
  297.  
  298. return h
  299.  
  300. end
  301.  
  302.  
  303.  
  304. for i,v in pairs(char:children()) do
  305.  
  306. if v.Name == Modelname then
  307.  
  308. v:remove()
  309.  
  310. end
  311.  
  312. end
  313.  
  314.  
  315.  
  316. torso = char.Torso
  317.  
  318. neck = torso.Neck
  319.  
  320. hum = char.Humanoid
  321.  
  322. Rarm = char["Right Arm"]
  323.  
  324. Larm = char["Left Arm"]
  325.  
  326. Rleg = char["Right Leg"]
  327.  
  328. Lleg = char["Left Leg"]
  329.  
  330.  
  331.  
  332. hc = Instance.new("Humanoid")
  333.  
  334. hc.Health = 0
  335.  
  336. hc.MaxHealth = 0
  337.  
  338.  
  339.  
  340. slash = Add.Sound(nil, "rbxasset://sounds//swordslash.wav", 0.9, 0.8)
  341.  
  342. hitsound = Add.Sound(nil, "http://www.roblox.com/asset/?id=2801263", 0.7, 0.6)
  343.  
  344. charge = Add.Sound(nil, "http://www.roblox.com/asset/?id=2101137", 0.8, 0.65)
  345.  
  346. boom = Add.Sound(nil, "http://www.roblox.com/asset/?id=2691586", 0.8, 0.3)
  347.  
  348. smashsound = Add.Sound(nil, "http://www.roblox.com/asset/?id=2692806", 0.8, 0.35)
  349.  
  350. boomboom = Add.Sound(nil, "http://www.roblox.com/asset/?id=2760979", 1, 0.18)
  351.  
  352.  
  353.  
  354. function PlaySound(sound, pitch, vol)
  355.  
  356. local s = sound:clone()
  357.  
  358. if pitch ~= nil then
  359.  
  360. if tonumber(pitch) then
  361.  
  362. s.Pitch = tonumber(pitch)
  363.  
  364. end
  365.  
  366. end
  367.  
  368. if vol ~= nil then
  369.  
  370. if tonumber(vol) then
  371.  
  372. s.Volume = tonumber(vol)
  373.  
  374. end
  375.  
  376. end
  377.  
  378. s.Parent = torso
  379.  
  380. s.PlayOnRemove = true
  381.  
  382. coroutine.resume(coroutine.create(function()
  383.  
  384. wait()
  385.  
  386. s:remove()
  387.  
  388. end))
  389.  
  390. end
  391.  
  392.  
  393.  
  394. Mo = Instance.new("Model")
  395.  
  396. Mo.Name = Modelname
  397.  
  398.  
  399.  
  400. RABrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  401.  
  402. LABrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  403.  
  404. RLBrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  405.  
  406. LLBrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  407.  
  408.  
  409.  
  410. RABW = Weld(torso, RABrick, -1.5, -0.5, 0, 0, 0, 0)
  411.  
  412. LABW = Weld(torso, LABrick, 1.5, -0.5, 0, 0, 0, 0)
  413.  
  414. RLBW = Weld(torso, RLBrick, -0.5, 1.2, 0, 0, 0, 0)
  415.  
  416. LLBW = Weld(torso, LLBrick, 0.5, 1.2, 0, 0, 0, 0)
  417.  
  418.  
  419.  
  420. RAW = Weld(RABrick, nil, 0, 0.5, 0, 0, 0, 0)
  421.  
  422. LAW = Weld(LABrick, nil, 0, 0.5, 0, 0, 0, 0)
  423.  
  424. RLW = Weld(RLBrick, nil, 0, 0.8, 0, 0, 0, 0)
  425.  
  426. LLW = Weld(LLBrick, nil, 0, 0.8, 0, 0, 0, 0)
  427.  
  428.  
  429.  
  430. HB = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  431.  
  432. HBW = Weld(Rarm, HB, 0, 1, 0, 0, 0, 0)
  433.  
  434. HW = Weld(HB, nil, 0, 0.3, 0, math.pi/2, math.pi, 0)
  435.  
  436.  
  437.  
  438. Mo.Parent = char
  439.  
  440.  
  441.  
  442. function MakeBanana()
  443.  
  444. local Banana = Part(workspace, false, true, 0, 0, "Bright yellow", 0.9, 0.95, 0.9, true)
  445.  
  446. Banana.Friction = 0.8
  447.  
  448. Banana.Elasticity = 0
  449.  
  450. local mes = Add.Mesh(Banana, "http://www.roblox.com/asset/?id=28937301", 1.3, 0.8, 1.3)
  451.  
  452. mes.TextureId = "http://www.roblox.com/asset/?id=28937670"
  453.  
  454. HW.Part1 = Banana
  455.  
  456. return Banana
  457.  
  458. end
  459.  
  460.  
  461.  
  462. if script.Parent.className ~= "HopperBin" then
  463.  
  464. h = Instance.new("HopperBin",me.Backpack)
  465.  
  466. h.Name = Toolname
  467.  
  468. h.TextureId = ToolIcon
  469.  
  470. script.Parent = h
  471.  
  472. end
  473.  
  474.  
  475.  
  476. bin = script.Parent
  477.  
  478.  
  479.  
  480. function detach(bool)
  481.  
  482. LLW.C0 = CFrame.new(0, 0, 0)
  483.  
  484. RLW.C0 = CFrame.new(0, 0, 0)
  485.  
  486. LAW.C0 = CFrame.new(0,0,0)
  487.  
  488. RAW.C0 = CFrame.new(0, 0, 0)
  489.  
  490. if bool then
  491.  
  492. LLW.Part1 = nil
  493.  
  494. RLW.Part1 = nil
  495.  
  496. RAW.Part1 = nil
  497.  
  498. LAW.Part1 = nil
  499.  
  500. end
  501.  
  502. end
  503.  
  504.  
  505.  
  506. function attach()
  507.  
  508. RAW.Part1 = Rarm
  509.  
  510. LAW.Part1 = Larm
  511.  
  512. RLW.Part1 = Rleg
  513.  
  514. LLW.Part1 = Lleg
  515.  
  516. end
  517.  
  518.  
  519.  
  520. function normal()
  521.  
  522. neck.C0 = NeckStand
  523.  
  524. RAW.C0 = RAWStand
  525.  
  526. LAW.C0 = LAWStand
  527.  
  528. RLW.C0 = RLWStand
  529.  
  530. LLW.C0 = LLWStand
  531.  
  532. RAW.C1 = CFrame.new(0, 0.5, 0)
  533.  
  534. LAW.C1 = CFrame.new(0, 0.5, 0)
  535.  
  536. RLW.C1 = CFrame.new(0, 0.8, 0)
  537.  
  538. LLW.C1 = CFrame.new(0, 0.8, 0)
  539.  
  540. HW.C0 = HWStand
  541.  
  542. end
  543.  
  544.  
  545.  
  546. function throw(mousepos)
  547.  
  548. RAW.Part1 = Rarm
  549.  
  550. for i = 0, 1, 0.2 do
  551.  
  552. RAW.C0 = CFrame.Angles(math.rad(-5*i), 0, math.rad(-15*i)) * CFrame.new(0, -0.2*i, -0.5*i)
  553.  
  554. wait()
  555.  
  556. end
  557.  
  558. local banana = MakeBanana()
  559.  
  560. for i = 0, 1, 0.14 do
  561.  
  562. RAW.C0 = CFrame.Angles(math.rad(-5+185*i), 0, math.rad(-15+35*i)) * CFrame.new(0, -0.2+0.1*i, -0.5+0.8*i)
  563.  
  564. wait()
  565.  
  566. end
  567.  
  568. for i = 0, 1, 0.25 do
  569.  
  570. RAW.C0 = CFrame.Angles(math.rad(-5+185-90*i), 0, math.rad(-15+35-45*i)) * CFrame.new(0, -0.2+0.1-0.4*i, -0.5+0.8-0.3*i)
  571.  
  572. wait()
  573.  
  574. end
  575.  
  576. local pos = CFrame.new(banana.Position, mousepos) * CFrame.Angles(math.rad(25),0,0)
  577.  
  578. local mag = (torso.Position - mousepos).magnitude
  579.  
  580. mag = mag - (mag/5)
  581.  
  582. if mag > 25 then mag = 25 end
  583.  
  584. local kert = (40+(mag*2))
  585.  
  586. Notime(function()
  587.  
  588. HW.Part1 = nil
  589.  
  590. wait()
  591.  
  592. banana.Velocity = pos.lookVector * kert
  593.  
  594. local bg = Add.BG(banana)
  595.  
  596. bg.P = 4500
  597.  
  598. bg.maxTorque = Vector3.new(math.huge, 0, math.huge)
  599.  
  600. wait(0.5)
  601.  
  602. repeat wait() until banana.Velocity.magnitude < 13
  603.  
  604. local ablez = true
  605.  
  606. local con = banana.Touched:connect(function(hit)
  607.  
  608. local hu = getHumanoid(hit.Parent)
  609.  
  610. if hu then
  611.  
  612. local to = hu.Parent:findFirstChild("Torso")
  613.  
  614. if to and ablez then
  615.  
  616. ablez = false
  617.  
  618. local bg = Add.BG(to)
  619.  
  620. hu.PlatformStand = true
  621.  
  622. local cf1 = to.CFrame
  623.  
  624. local cf2 = CFrame.new(cf1.p, (cf1 * CFrame.new(0, 0, -2).p))
  625.  
  626. to.Velocity = to.Velocity + (cf1.lookVector * -15) + Vector3.new(0, 35, 0)
  627.  
  628. local ah = math.random(260,280)
  629.  
  630. local mm = math.random(5,8)/100
  631.  
  632. Notime(function()
  633.  
  634. wait(0.25)
  635.  
  636. ablez = true
  637.  
  638. end)
  639.  
  640. banana.Velocity = cf1.lookVector * 35
  641.  
  642. for i = 0, 1, mm do
  643.  
  644. bg.cframe = cf2 * CFrame.Angles(math.rad(ah*i), 0, 0)
  645.  
  646. wait()
  647.  
  648. end
  649.  
  650. wait()
  651.  
  652. bg:remove()
  653.  
  654. wait(0.4)
  655.  
  656. hu.PlatformStand = false
  657.  
  658. end
  659.  
  660. end
  661.  
  662. end)
  663.  
  664. wait(math.random(18,22))
  665.  
  666. con:disconnect()
  667.  
  668. for i = 0, 1, 0.033 do
  669.  
  670. banana.Transparency = i
  671.  
  672. wait()
  673.  
  674. end
  675.  
  676. banana:remove()
  677.  
  678. end)
  679.  
  680. for i = 0, 1, 0.16 do
  681.  
  682. RAW.C0 = CFrame.Angles(math.rad(-5+185-90-90*i), 0, math.rad(-15+35-45+25*i)) * CFrame.new(0, -0.2+0.1-0.4+0.5*i, 0)
  683.  
  684. wait()
  685.  
  686. end
  687.  
  688. detach(true)
  689.  
  690. end
  691.  
  692.  
  693.  
  694. function select(mouse)
  695.  
  696. selected = true
  697.  
  698. mouse.Button1Down:connect(function()
  699.  
  700. if Able then
  701.  
  702. Able = false
  703.  
  704. throw(mouse.Hit.p)
  705.  
  706. wait(0.5)
  707.  
  708. Able = true
  709.  
  710. end
  711.  
  712. end)
  713.  
  714. end
  715.  
  716.  
  717.  
  718. function deselect(mouse)
  719.  
  720. selected = false
  721.  
  722. end
  723.  
  724.  
  725.  
  726. bin.Selected:connect(select)
  727.  
  728. bin.Deselected:connect(deselect)
Advertisement
Add Comment
Please, Sign In to add comment