local Player = game.Players.LocalPlayer local Character = Player.Character local Humanoid = Character:WaitForChild("Humanoid") local Mouse = Player:GetMouse() local UserID = Player.userId Player:WaitForChild('PlayerGui') Player:WaitForChild('Backpack') Character:WaitForChild('Head') Character:WaitForChild('Torso') -------------------------------------------- -- Set the IDs below. (Numbers only) local AnimSlot1 = "664485903" -- ~ local AnimSlot2 = "664052022" -- ~ local AnimSlot3 = "664853215" -- ~ local AnimSlot4 = "664949014" -- ~ local AnimSlot5 = "0" -- ~ local AnimSlot6 = "0" -- ~ local AnimSlot7 = "0" -- ~ local AnimSlot8 = "0" -- ~ local AnimSlot9 = "0" -- ~ local AnimSlot10 = "0" -- ~ -------------------------------------------- -- Keys to press to play animations (they're in the same order to play every animation for the slot you've set local KeyPressSlot1 = "R" local KeyPressSlot2 = "T" local KeyPressSlot3 = "G" local KeyPressSlot4 = "F" local KeyPressSlot5 = "" local KeyPressSlot6 = "" local KeyPressSlot7 = "" local KeyPressSlot8 = "" local KeyPressSlot9 = "" local KeyPressSlot10 = "" -------------------------------------------- local AnimBlock1 = true local AnimBlock2 = true local AnimBlock3 = true local AnimBlock4 = true local AnimBlock5 = true local AnimBlock6 = true local AnimBlock7 = true local AnimBlock8 = true local AnimBlock9 = true local AnimBlock10 = true -------------------------------------------- -- Below; set the speed for every animation. leave as "DefaultSpeed" for the '16'. You can change it to like anything. local AnimSpeed1 = 16 local AnimSpeed2 = 16 local AnimSpeed3 = 10 local AnimSpeed4 = 10 local AnimSpeed5 = 16 local AnimSpeed6 = 16 local AnimSpeed7 = 16 local AnimSpeed8 = 16 local AnimSpeed9 = 16 local AnimSpeed10 = 16 -------------------------------------------- Don't edit below. local UrlCode = "http://www.roblox.com/Asset?ID=" local Animation = Instance.new("Animation") local Track = nil local CanPlay = true -------------------------------------------- function setBackpackDisplay(show) game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, show) end function setHealthDisplay(show) game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, show) end function setPlayerListDisplay(show) game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, show) end function setChatDisplay(show) game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, show) end function setAllDisplay(show) game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, show) end -------------------------------------------- blockEquip = script.resources.blockEquipment function loadAnimation(Id, PlayerSpeed, blockTools) if CanPlay == true then CanPlay = false Animation.AnimationId = (UrlCode..Id) Track = Humanoid:LoadAnimation(Animation) Track:Play() Humanoid.WalkSpeed = PlayerSpeed allowTools = blockTools print 'playing' if allowTools == true then setBackpackDisplay(false) blockEquip.Disabled = false end end end function UnloadAnimation() if CanPlay == false then blockEquip.Disabled = true setBackpackDisplay(true) Track:Stop() Humanoid.WalkSpeed = 16 print 'removing' CanPlay = true end end -------------------------------------------- 1 Mouse.KeyDown:connect(function(Key) if (string.upper(Key) == KeyPressSlot1) and CanPlay == true then loadAnimation(AnimSlot1, AnimSpeed1, AnimBlock1) elseif (string.upper(Key) == KeyPressSlot1) and CanPlay == false then UnloadAnimation() end end) -------------------------------------------- 2 Mouse.KeyDown:connect(function(Key) if (string.upper(Key) == KeyPressSlot2) and CanPlay == true then loadAnimation(AnimSlot2, AnimSpeed2, AnimBlock2) elseif (string.upper(Key) == KeyPressSlot2) and CanPlay == false then UnloadAnimation() end end) -------------------------------------------- 3 Mouse.KeyDown:connect(function(Key) if (string.upper(Key) == KeyPressSlot3) and CanPlay == true then loadAnimation(AnimSlot3, AnimSpeed3, AnimBlock3) elseif (string.upper(Key) == KeyPressSlot3) and CanPlay == false then UnloadAnimation() end end) -------------------------------------------- 4 Mouse.KeyDown:connect(function(Key) if (string.upper(Key) == KeyPressSlot4) and CanPlay == true then loadAnimation(AnimSlot4, AnimSpeed4, AnimBlock4) elseif (string.upper(Key) == KeyPressSlot4) and CanPlay == false then UnloadAnimation() end end) -------------------------------------------- 5 Mouse.KeyDown:connect(function(Key) if (string.upper(Key) == KeyPressSlot5) and CanPlay == true then loadAnimation(AnimSlot5, AnimSpeed5, AnimBlock5) elseif (string.upper(Key) == KeyPressSlot5) and CanPlay == false then UnloadAnimation() end end) -------------------------------------------- 6 Mouse.KeyDown:connect(function(Key) if (string.upper(Key) == KeyPressSlot6) and CanPlay == true then loadAnimation(AnimSlot6, AnimSpeed6, AnimBlock6) elseif (string.upper(Key) == KeyPressSlot6) and CanPlay == false then UnloadAnimation() end end) -------------------------------------------- 7 Mouse.KeyDown:connect(function(Key) if (string.upper(Key) == KeyPressSlot7) and CanPlay == true then loadAnimation(AnimSlot7, AnimSpeed7, AnimBlock7) elseif (string.upper(Key) == KeyPressSlot7) and CanPlay == false then UnloadAnimation() end end) -------------------------------------------- 8 Mouse.KeyDown:connect(function(Key) if (string.upper(Key) == KeyPressSlot8) and CanPlay == true then loadAnimation(AnimSlot8, AnimSpeed8, AnimBlock8) elseif (string.upper(Key) == KeyPressSlot8) and CanPlay == false then UnloadAnimation() end end) -------------------------------------------- 9 Mouse.KeyDown:connect(function(Key) if (string.upper(Key) == KeyPressSlot9) and CanPlay == true then loadAnimation(AnimSlot9, AnimSpeed9, AnimBlock9) elseif (string.upper(Key) == KeyPressSlot9) and CanPlay == false then UnloadAnimation() end end) -------------------------------------------- 10 Mouse.KeyDown:connect(function(Key) if (string.upper(Key) == KeyPressSlot10) and CanPlay == true then loadAnimation(AnimSlot10, AnimSpeed10, AnimBlock10) elseif (string.upper(Key) == KeyPressSlot10) and CanPlay == false then UnloadAnimation() end end)
None of that is my work but that is what I used for my animations to work. I'm a boxing fan so I decided to make some punching animations but I'm unsure of how to apply damage to them. I want the animations to do damage to other players not NPCs. Yesterday was the first time I've ever even attempted to script so my scripting experience and terminology is poor. So I have 2 questions, 1. How do I apply damage to my new animations and 2. what do I do with the script when I'm done? To be clear, it's health damage I'm looking for.