SHARE
TWEET

Untitled

a guest Jul 17th, 2017 42 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Plrs = game:GetService("Players")
  2. me = Plrs.LocalPlayer
  3. char = me.Character
  4. Modelname = "xBananaz"
  5. Toolname = "Banana"
  6. Surfaces = {"FrontSurface", "BackSurface", "TopSurface", "BottomSurface", "LeftSurface", "RightSurface"}
  7. necko = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  8. selected = false
  9. Able = true
  10. Prop = {Damage = 30}
  11.  
  12. ToolIcon = ""
  13. MouseIc = ""
  14. MouseDo = ""
  15.  
  16. function Notime(func, tim)
  17.     coroutine.resume(coroutine.create(function()
  18.         if tim then
  19.             wait(tim)
  20.         end
  21.         func()
  22.     end))
  23. end
  24.  
  25. Add = {
  26.     Sphere = function(P)
  27.         local m = Instance.new("SpecialMesh",P)
  28.         m.MeshType = "Sphere"
  29.         return m
  30.     end,
  31.     BF = function(P)
  32.         local bf = Instance.new("BodyForce",P)
  33.         bf.force = Vector3.new(0, P:GetMass()*187, 0)
  34.         return bf
  35.     end,
  36.     BP = function(P)
  37.         local bp = Instance.new("BodyPosition",P)
  38.         bp.maxForce = Vector3.new(math.huge, 0, math.huge)
  39.         bp.P = 14000
  40.         return bp
  41.     end,
  42.     BG = function(P)
  43.         local bg = Instance.new("BodyGyro",P)
  44.         bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  45.         bg.P = 14000
  46.         return bg
  47.     end,
  48.     Mesh = function(P, ID, x, y, z)
  49.         local m = Instance.new("SpecialMesh")
  50.         m.MeshId = ID
  51.         m.Scale = Vector3.new(x, y, z)
  52.         m.Parent = P
  53.         return m
  54.     end,
  55.     Sound = function(P, ID, vol, pitch)
  56.         local s = Instance.new("Sound")
  57.         s.SoundId = ID
  58.         s.Volume = vol
  59.         s.Pitch = pitch
  60.         s.Parent = P
  61.         return s
  62.     end
  63. }
  64.  
  65. function find(tab, arg)
  66.     local ah = nil
  67.     for i,v in pairs(tab) do
  68.         if v == arg then
  69.             ah = v
  70.         end
  71.     end
  72.     return ah
  73. end
  74.  
  75. function getAllParts(from)
  76.     local t = {}
  77.     function getParts(where)
  78.         for i, v in pairs(where:children()) do
  79.             if v:IsA("BasePart") then
  80.                 if v.Parent ~= char and v.Parent.Parent ~= char then
  81.                     table.insert(t, v)
  82.                 end
  83.             end
  84.             getParts(v)
  85.         end
  86.     end
  87.     getParts(workspace)
  88.     return t
  89. end
  90.  
  91. function RayCast(pos1, pos2, maxDist, forward)
  92.     local list = getAllParts(workspace)
  93.     local pos0 = pos1
  94.     for dist = 1, maxDist, forward do
  95.         pos0 = (CFrame.new(pos1, pos2) * CFrame.new(0, 0, -dist)).p
  96.         for _, v in pairs(list) do
  97.             local pos3 = v.CFrame:pointToObjectSpace(pos0)
  98.             local s = v.Size
  99.             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
  100.                 return pos0, v
  101.             end
  102.         end
  103.     end
  104.     return pos0, nil
  105. end
  106.  
  107. function Part(Parent, Anchor, Collide, Tran, Ref, Color, X, Y, Z, Break)
  108.     local p = Instance.new("Part")
  109.     p.formFactor = "Custom"
  110.     p.Anchored = Anchor
  111.     p.CanCollide = Collide
  112.     p.Transparency = Tran
  113.     p.Reflectance = Ref
  114.     p.BrickColor = BrickColor.new(Color)
  115.     for _, Surf in pairs(Surfaces) do
  116.         p[Surf] = "Smooth"
  117.     end
  118.     p.Size = Vector3.new(X, Y, Z)
  119.     if Break then
  120.         p:BreakJoints()
  121.     else p:MakeJoints() end
  122.     p.Parent = Parent
  123.     return p
  124. end
  125.  
  126. function Weld(p0, p1, x, y, z, a, b, c)
  127.     local w = Instance.new("Weld")
  128.     w.Parent = p0
  129.     w.Part0 = p0
  130.     w.Part1 = p1
  131.     w.C1 = CFrame.new(x,y,z) * CFrame.Angles(a,b,c)
  132.     return w
  133. end
  134.  
  135. function ComputePos(pos1, pos2)
  136.     local pos3 = Vector3.new(pos2.x, pos1.y, pos2.z)
  137.     return CFrame.new(pos1, pos3)
  138. end
  139.  
  140. function getHumanoid(c)
  141.     local h = nil
  142.     for i,v in pairs(c:children()) do
  143.         if v:IsA("Humanoid") then
  144.             if v.Health > 0 then
  145.                 h = v
  146.             end
  147.         end
  148.     end
  149.     return h
  150. end
  151.  
  152. for i,v in pairs(char:children()) do
  153.     if v.Name == Modelname then
  154.         v:remove()
  155.     end
  156. end
  157.  
  158. torso = char.Torso
  159. neck = torso.Neck
  160. hum = char.Humanoid
  161. Rarm = char["Right Arm"]
  162. Larm = char["Left Arm"]
  163. Rleg = char["Right Leg"]
  164. Lleg = char["Left Leg"]
  165.  
  166. hc = Instance.new("Humanoid")
  167. hc.Health = 0
  168. hc.MaxHealth = 0
  169.  
  170. slash = Add.Sound(nil, "rbxasset://sounds//swordslash.wav", 0.9, 0.8)
  171. hitsound = Add.Sound(nil, "http://www.roblox.com/asset/?id=2801263", 0.7, 0.6)
  172. charge = Add.Sound(nil, "http://www.roblox.com/asset/?id=2101137", 0.8, 0.65)
  173. boom = Add.Sound(nil, "http://www.roblox.com/asset/?id=2691586", 0.8, 0.3)
  174. smashsound = Add.Sound(nil, "http://www.roblox.com/asset/?id=2692806", 0.8, 0.35)
  175. boomboom = Add.Sound(nil, "http://www.roblox.com/asset/?id=2760979", 1, 0.18)
  176.  
  177. function PlaySound(sound, pitch, vol)
  178.     local s = sound:clone()
  179.     if pitch ~= nil then
  180.         if tonumber(pitch) then
  181.             s.Pitch = tonumber(pitch)
  182.         end
  183.     end
  184.     if vol ~= nil then
  185.         if tonumber(vol) then
  186.             s.Volume = tonumber(vol)
  187.         end
  188.     end
  189.     s.Parent = torso
  190.     s.PlayOnRemove = true
  191.     coroutine.resume(coroutine.create(function()
  192.         wait()
  193.         s:remove()
  194.     end))
  195. end
  196.  
  197. Mo = Instance.new("Model")
  198. Mo.Name = Modelname
  199.  
  200. RABrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  201. LABrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  202. RLBrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  203. LLBrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  204.  
  205. RABW = Weld(torso, RABrick, -1.5, -0.5, 0, 0, 0, 0)
  206. LABW = Weld(torso, LABrick, 1.5, -0.5, 0, 0, 0, 0)
  207. RLBW = Weld(torso, RLBrick, -0.5, 1.2, 0, 0, 0, 0)
  208. LLBW = Weld(torso, LLBrick, 0.5, 1.2, 0, 0, 0, 0)
  209.  
  210. RAW = Weld(RABrick, nil, 0, 0.5, 0, 0, 0, 0)
  211. LAW = Weld(LABrick, nil, 0, 0.5, 0, 0, 0, 0)
  212. RLW = Weld(RLBrick, nil, 0, 0.8, 0, 0, 0, 0)
  213. LLW = Weld(LLBrick, nil, 0, 0.8, 0, 0, 0, 0)
  214.  
  215. HB = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  216. HBW = Weld(Rarm, HB, 0, 1, 0, 0, 0, 0)
  217. HW = Weld(HB, nil, 0, 0.3, 0, math.pi/2, math.pi, 0)
  218.  
  219. Mo.Parent = char
  220.  
  221. function MakeBanana()
  222.     local Banana = Part(workspace, false, true, 0, 0, "Bright yellow", 0.9, 0.95, 0.9, true)
  223.     Banana.Friction = 0.8
  224.     Banana.Elasticity = 0
  225.     local mes = Add.Mesh(Banana, "http://www.roblox.com/asset/?id=28937301", 1.3, 0.8, 1.3)
  226.     mes.TextureId = "http://www.roblox.com/asset/?id=28937670"
  227.     HW.Part1 = Banana
  228.     return Banana
  229. end
  230.  
  231. if script.Parent.className ~= "HopperBin" then
  232.     h = Instance.new("HopperBin",me.Backpack)
  233.     h.Name = Toolname
  234.     h.TextureId = ToolIcon
  235.     script.Parent = h
  236. end
  237.  
  238. bin = script.Parent
  239.  
  240. function detach(bool)
  241.     LLW.C0 = CFrame.new(0, 0, 0)
  242.     RLW.C0 = CFrame.new(0, 0, 0)
  243.     LAW.C0 = CFrame.new(0,0,0)
  244.     RAW.C0 = CFrame.new(0, 0, 0)
  245.     if bool then
  246.         LLW.Part1 = nil
  247.         RLW.Part1 = nil
  248.         RAW.Part1 = nil
  249.         LAW.Part1 = nil
  250.     end
  251. end
  252.  
  253. function attach()
  254.     RAW.Part1 = Rarm
  255.     LAW.Part1 = Larm
  256.     RLW.Part1 = Rleg
  257.     LLW.Part1 = Lleg
  258. end
  259.  
  260. function normal()
  261.     neck.C0 = NeckStand
  262.     RAW.C0 = RAWStand
  263.     LAW.C0 = LAWStand
  264.     RLW.C0 = RLWStand
  265.     LLW.C0 = LLWStand
  266.     RAW.C1 = CFrame.new(0, 0.5, 0)
  267.     LAW.C1 = CFrame.new(0, 0.5, 0)
  268.     RLW.C1 = CFrame.new(0, 0.8, 0)
  269.     LLW.C1 = CFrame.new(0, 0.8, 0)
  270.     HW.C0 = HWStand
  271. end
  272.  
  273. function throw(mousepos)
  274.     RAW.Part1 = Rarm
  275. --[[    for i = 0, 1, 1 do
  276.         RAW.C0 = CFrame.Angles(math.rad(-5*i), 0, math.rad(-15*i)) * CFrame.new(0, -0.2*i, -0.5*i)
  277.         wait()
  278.     end]]
  279.     local banana = MakeBanana()
  280.     for i = 0, 1, 1 do
  281.         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)
  282.         wait()
  283.     end
  284. --[[    for i = 0, 1, 1 do
  285.         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)
  286.         wait()
  287.     end]]
  288.     local pos = CFrame.new(banana.Position, mousepos) * CFrame.Angles(math.rad(25),0,0)
  289.     local mag = (torso.Position - mousepos).magnitude
  290.     mag = mag - (mag/5)
  291.     if mag > 25 then mag = 25 end
  292.     local kert = (40+(mag*2))
  293.     Notime(function()
  294.         HW.Part1 = nil
  295.         wait()
  296.         banana.Velocity = pos.lookVector * kert
  297.         local bg = Add.BG(banana)
  298.         bg.P = 4500
  299.         bg.maxTorque = Vector3.new(math.huge, 0, math.huge)
  300.         wait(0.5)
  301.         repeat wait() until banana.Velocity.magnitude < 13
  302.         local ablez = true
  303.         local con = banana.Touched:connect(function(hit)
  304.             local hu = getHumanoid(hit.Parent)
  305.             if hu then
  306.                 local to = hu.Parent:findFirstChild("Torso")
  307.                 local s = Instance.new("Sound")
  308.                 s.SoundId = "http://www.roblox.com/asset/?id=28976727"
  309.                 s.Volume = 1
  310.                 s.Pitch = 1
  311.                 s.Parent = to
  312.                 s:Play()
  313.                 game:GetService("Debris"):AddItem(s,1)
  314.                 if to and ablez then
  315.                     ablez = false
  316.                     local bg = Add.BG(to)
  317.                     hu.PlatformStand = true
  318.                     local cf1 = to.CFrame
  319.                     local cf2 = CFrame.new(cf1.p, (cf1 * CFrame.new(0, 0, -2).p))
  320.                     to.Velocity = to.Velocity + (cf1.lookVector * -15) + Vector3.new(0, 100, 0)
  321.                     local ah = math.random(260,280)
  322.                     local mm = math.random(5,8)/100
  323.                     Notime(function()
  324.                         wait(0.25)
  325.                         ablez = true
  326.                     end)
  327.                     banana.Velocity = cf1.lookVector * 35
  328.                     for i = 0, 1, mm do
  329.                         bg.cframe = cf2 * CFrame.Angles(math.rad(ah*i), 0, 0)
  330.                         wait()
  331.                     end
  332.                     wait()
  333.                     bg:remove()
  334.                     wait(0.4)
  335.                     hu.PlatformStand = false
  336.                 end
  337.             end
  338.         end)
  339.         wait(math.random(18,22))
  340.         con:disconnect()
  341.         for i = 0, 1, 0.033 do
  342.             banana.Transparency = i
  343.             wait()
  344.         end
  345.         banana:remove()
  346.     end)
  347.     for i=1,10 do
  348. wait(0)
  349. for i=1,10 do
  350.     local banana = MakeBanana()
  351.     local pos = CFrame.new(banana.Position, mousepos) * CFrame.Angles(math.rad(25),0,0)
  352.     local mag = (torso.Position - mousepos).magnitude
  353.     mag = mag - (mag/5)
  354.     if mag > 25 then mag = 25 end
  355.     local kert = (40+(mag*2))
  356.     Notime(function()
  357.         HW.Part1 = nil
  358.         wait()
  359.         banana.Velocity = pos.lookVector * kert
  360.         local bg = Add.BG(banana)
  361.         bg.P = 4500
  362.         bg.maxTorque = Vector3.new(math.huge, 0, math.huge)
  363.         wait(0.5)
  364.         repeat wait() until banana.Velocity.magnitude < 13
  365.         local ablez = true
  366.         local con = banana.Touched:connect(function(hit)
  367.             local hu = getHumanoid(hit.Parent)
  368.             if hu then
  369.                 local to = hu.Parent:findFirstChild("Torso")
  370.                 local s = Instance.new("Sound")
  371.                 s.SoundId = "http://www.roblox.com/asset/?id=28976727"
  372.                 s.Volume = 1
  373.                 s.Pitch = math.random(50,150)/100
  374.                 s.Parent = to
  375.                 s:Play()
  376.                 game:GetService("Debris"):AddItem(s,1)
  377.                 if to and ablez then
  378.                     ablez = false
  379.                     local bg = Add.BG(to)
  380.                     hu.PlatformStand = true
  381.                     local cf1 = to.CFrame
  382.                     local cf2 = CFrame.new(cf1.p, (cf1 * CFrame.new(0, 0, -2).p))
  383.                     to.Velocity = to.Velocity + (cf1.lookVector * -15) + Vector3.new(0, 100, 0)
  384.                     local ah = math.random(260,280)
  385.                     local mm = math.random(5,8)/100
  386.                     Notime(function()
  387.                         wait(0.25)
  388.                         ablez = true
  389.                     end)
  390.                     banana.Velocity = cf1.lookVector * 35
  391.                     for i = 0, 1, mm do
  392.                         bg.cframe = cf2 * CFrame.Angles(math.rad(ah*i), 0, 0)
  393.                         wait()
  394.                     end
  395.                     wait()
  396.                     bg:remove()
  397.                     wait(0.4)
  398.                     hu.PlatformStand = false
  399.                 end
  400.             end
  401.         end)
  402.         wait(math.random(18,22))
  403.         con:disconnect()
  404.         for i = 0, 1, 0.033 do
  405.                         wait()
  406.         end
  407.        
  408.     end)
  409.     end
  410.     end
  411.     for i = 0, 1, 1 do
  412.         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)
  413.         wait()
  414.     end
  415.     detach(true)
  416. end
  417.  
  418. function select(mouse)
  419.     selected = true
  420.     mouse.Button1Down:connect(function()
  421.         if Able then
  422.             Able = true
  423.             char.Torso.Anchored=true
  424.             throw(mouse.Hit.p)
  425.             char.Torso.Anchored=false
  426.             wait(0)
  427.             Able = true
  428.         end
  429.     end)
  430. end
  431.  
  432. function deselect(mouse)
  433.     selected = false
  434. end
  435.  
  436. bin.Selected:connect(select)
  437. bin.Deselected:connect(deselect)
  438. -- mediafire
RAW Paste Data
Pastebin PRO Summer Special!
Get 60% OFF on Pastebin PRO accounts!
Top