LightSynapse

Roblox High School RP Knife

Jul 3rd, 2018
2,605
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.03 KB | None | 0 0
  1. --Just a regular knife script
  2. OOHNELLY = Instance.new("Tool")
  3. NELLAY = Instance.new("Animation")
  4. NOTSEEEE = Instance.new("Part")
  5. LEECHYISHERE = Instance.new("Sound")
  6. SPECIALMESHXDDDD = Instance.new("SpecialMesh")
  7. SEIGHEIL = Instance.new("Sound")
  8. OOHNELLY.Name = "Knife"
  9. OOHNELLY.Parent = game.Players.LocalPlayer.Backpack
  10. OOHNELLY.GripForward = Vector3.new(-1.74845553e-007, 4.37113812e-008, 1)
  11. OOHNELLY.GripPos = Vector3.new(0.487703323, -3.7742065e-010, 0.00863459334)
  12. OOHNELLY.GripRight = Vector3.new(-7.64274186e-015, -1, 4.37113812e-008)
  13. OOHNELLY.GripUp = Vector3.new(-1, 0, -1.74845553e-007)
  14. OOHNELLY.CanBeDropped = false -- no removal unless you wanna shank urself
  15. NELLAY.Name = "Whack"
  16. NELLAY.Parent = OOHNELLY
  17. NELLAY.AnimationId = "http://www.roblox.com/Asset?ID=94161088"
  18. NOTSEEEE.Name = "Handle"
  19. NOTSEEEE.Parent = OOHNELLY
  20. NOTSEEEE.BrickColor = BrickColor.new("Really black")
  21. NOTSEEEE.Reflectance = 0.0099999997764826
  22. NOTSEEEE.Position = Vector3.new(-5.70826387, 0.254999995, 10.8100071)
  23. NOTSEEEE.Size = Vector3.new(1.54999995, 0.50999999, 0.699999988)
  24. NOTSEEEE.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  25. LEECHYISHERE.Name = "Swoosh"
  26. LEECHYISHERE.Parent = NOTSEEEE
  27. LEECHYISHERE.Pitch = 3
  28. LEECHYISHERE.SoundId = "http://www.roblox.com/asset?id=153647529"
  29. LEECHYISHERE.Volume = 1
  30. LEECHYISHERE.PlayOnRemove = true
  31. SPECIALMESHXDDDD.Parent = NOTSEEEE
  32. SPECIALMESHXDDDD.MeshId = "rbxassetid://442337985"
  33. SPECIALMESHXDDDD.Offset = Vector3.new(-0.600000024, 0, -0.200000003)
  34. SPECIALMESHXDDDD.Scale = Vector3.new(0.300000012, 0.300000012, 0.300000012)
  35. SPECIALMESHXDDDD.TextureId = "rbxassetid://442337993"
  36. SPECIALMESHXDDDD.MeshType = "FileMesh"
  37. SEIGHEIL.Name = "Ting"
  38. SEIGHEIL.Parent = NOTSEEEE
  39. SEIGHEIL.SoundId = "rbxassetid://429400881"
  40. SEIGHEIL.Volume = 0.20000000298023
  41. OOHNELLY = OOHNELLY
  42. Handle = OOHNELLY:WaitForChild("Handle")
  43.  
  44. Players = game:GetService("Players")
  45. Debris = game:GetService("Debris")
  46. InsertService = game:GetService("InsertService")
  47.  
  48. WhackAnim = OOHNELLY:WaitForChild("Whack")
  49. SlashSound = Handle:WaitForChild("Swoosh")
  50. HitSound = Handle:WaitForChild("Ting")
  51.  
  52. Damage = 100 --the damage dealt
  53.  
  54. ReloadTime = 1.45 --time between each swing
  55.  
  56. Kills = 0 --start off with 0 killstreak
  57.  
  58. function TagHumanoid(humanoid, player) --registers you actually hitting the guy
  59.     HitSound:Play()
  60.     local Creator_Tag = Instance.new("ObjectValue")
  61.     Creator_Tag.Name = "creator"
  62.     Creator_Tag.Value = player
  63.     Debris:AddItem(Creator_Tag, 2)
  64.     Creator_Tag.Parent = humanoid
  65. end
  66.  
  67. function UntagHumanoid(humanoid) --removes the tag so that if someone kills the person you tagged, it doesnt register you killing that person.
  68.     for i, v in pairs(humanoid:GetChildren()) do
  69.         if v:IsA("ObjectValue") and v.Name == "creator" then
  70.             v:Destroy()
  71.         end
  72.     end
  73. end
  74.  
  75. function Blow(Hit) --registers the hit, deals damage to the player, and if the humanoid has 0 health a kill is added into the killstreak.
  76.     if Hit and Hit.Parent then
  77.         local character = Hit.Parent
  78.         local humanoid = character:FindFirstChild("Humanoid")
  79.         if Humanoid and Humanoid ~= humanoid and humanoid and Humanoid.Health > 0 and humanoid.Health > 0 then
  80.             local Right_Arm = Character:FindFirstChild("Right Arm")
  81.             if Right_Arm then
  82.                 local Joint = Right_Arm:FindFirstChild("RightGrip")
  83.                 if (Joint and (Joint.Part0 == Handle or Joint.Part1 == Handle)) then
  84.                     humanoid:TakeDamage(Damage) --deal regular damage or instakill normal health players if a ninja
  85.                     UntagHumanoid(humanoid)
  86.                     TagHumanoid(humanoid, Player)
  87.                 end
  88.             end
  89.         end
  90.     end
  91. end
  92.  
  93. function Activated() --when you swing
  94.     if OOHNELLY.Enabled then
  95.         OOHNELLY.Enabled = false
  96.         Whack = Humanoid:LoadAnimation(WhackAnim)
  97.         if Whack then
  98.             Whack:Play()
  99.             SlashSound:Play()
  100.             wait(.6)
  101.             Whack:Stop()
  102.         end
  103.         OOHNELLY.Enabled = true
  104.     end
  105. end
  106.  
  107. function Equipped(mouse) --get everything settled up
  108.     Character = OOHNELLY.Parent
  109.     Player = Players:GetPlayerFromCharacter(Character)
  110.     Humanoid = Character:FindFirstChild("Humanoid")
  111.     Torso = Character:FindFirstChild("Torso")
  112.     if not Humanoid or not Torso then
  113.         return  
  114.     end
  115.    
  116.     if not OOHNELLY.Enabled then
  117.         wait(ReloadTime)
  118.         OOHNELLY.Enabled = true
  119.     end
  120. end
  121.  
  122. function Unequipped()
  123.     if Whack then
  124.         Whack:Stop() --stop the swing anim so we dont get stuck
  125.     end
  126. end
  127.  
  128. --important stuff to register what is what. you need these if you want to do stuff with the OOHNELLY itself.
  129. OOHNELLY.Activated:connect(Activated)
  130. OOHNELLY.Equipped:connect(Equipped)
  131. OOHNELLY.Unequipped:connect(Unequipped)
  132.  
  133. Handle.Touched:connect(Blow)
  134. end)
  135.  
  136. b4.MouseButton1Click:connect(function()
  137. -- Made By Pugz AKA (ItzDan)
  138. plyr = game.Players.LocalPlayer
  139. c = plyr.Character
  140. RunService = game:service'RunService'
  141. mouse = game.Players.LocalPlayer:GetMouse()
  142. local draw2 = false
  143. local colorA = 1
  144. local lastPos
  145.  
  146. tool = Instance.new("HopperBin", plyr.Backpack)
  147. tool.Name = "Draw"
  148.  
  149.  
  150.  
  151. mouse = plyr:GetMouse()
  152.  
  153.  
  154.                 function draw(obj) --
  155.     local lastPos = obj.CFrame.p
  156.     coroutine.wrap(function()
  157.         while wait() do
  158.         if draw2 then
  159.         while draw2 do
  160.             RunService.Stepped:wait()
  161.             objC = obj:Clone()
  162.                         objC.Parent = c
  163.             objC.Anchored = true
  164.             local distance = (lastPos- obj.CFrame.p).magnitude
  165.             objC.Size = Vector3.new(.2,.2,distance)
  166.             objC.CFrame = CFrame.new(lastPos,obj.Position)*CFrame.new(0,0,-distance/2)
  167.             lastPos = obj.CFrame.p
  168.         end
  169.         else
  170.                 break
  171.         end
  172.         end
  173.     end)()
  174.                 end
  175.  
  176. tool.Selected:connect(function(mouse)
  177.        
  178.         mouse.Button1Down:connect(function(mouse)
  179.                 part = Instance.new("Part", c)
  180.                 part.Name = "location"
  181.                 part.BottomSurface = 0
  182.                 part.TopSurface = 0
  183.                 part.BrickColor = BrickColor.Blue()
  184.                 part.Material = "Neon"
  185.                 part.FormFactor = "Custom"
  186.                 part.Size = Vector3.new(0.2, 0.2, 0.2)
  187.                 part.Anchored = true
  188.                 part.Locked = true
  189.                 coroutine.wrap(function()
  190.                 while part ~= nil do
  191.                 part.CFrame = CFrame.new(plyr:GetMouse().Hit.p.x,plyr:GetMouse().Hit.p.y,plyr:GetMouse().Hit.p.z)
  192.                 RunService.Stepped:wait()
  193.                 end
  194.                 end)()        
  195.                 draw(part)
  196.                 draw2 = true
  197.         end)
  198.         mouse.Button1Up:connect(function(mouse)
  199.                 game:service'Debris':AddItem(part, 0)
  200.                 draw2 = false
  201.                 pcall(function()
  202.                 lastPos = nil
  203.                 end)
  204.                
  205.         end)
  206.                        
  207. end)
Advertisement
Add Comment
Please, Sign In to add comment