How do i make my dropkick script do damage in roblox?
how do i make this script deal damage to a player?
what i have here is a dropkick script, i already added the leg tables and i dont know what to do next.
basically what i want to achieve is to make a player deal damage when their legs touch an
enemy. please help
04 | local UIS = game:GetService( "UserInputService" ) |
05 | local character = script.Parent |
06 | local humanoid = character:WaitForChild( "Humanoid" ) |
07 | local DropAnim = Instance.new( "Animation" ) |
10 | local CanDropkick = false |
11 | local Keybind = Enum.KeyCode.E |
12 | local LeftLeg = game.Players.LocalPlayer.Character [ "Left Leg" ] |
13 | local RightLeg = game.Players.LocalPlayer.Character [ "Right Leg" ] |
17 | local Table = { LeftLeg,RightLeg } |
20 | character.Humanoid.Running:Connect( function (speed) |
21 | if speed > topspeed then |
24 | else if speed < topspeed then |
31 | humanoid:GetPropertyChangedSignal( "FloorMaterial" ):Connect( function () |
32 | if humanoid.FloorMaterial = = Enum.Material.Air then |
35 | else if humanoid.FloorMaterial = = Enum.Material.Ground then |
42 | UIS.InputBegan:Connect( function (input,gameprocessed) |
43 | if gameprocessed then return end |
44 | if not CanDropkick then return end |
45 | if input.KeyCode = = Keybind then |
48 | local playAnim = character.Humanoid:LoadAnimation(DropAnim) |
51 | local drop = Instance.new( "BodyVelocity" ) |
52 | drop.MaxForce = Vector 3. new ( 1 , 0 , 1 ) * 30000 |
53 | drop.Velocity = character.HumanoidRootPart.CFrame.lookVector * 85 |
54 | drop.Parent = character.HumanoidRootPart |