#My knife still hitting people after equip/unequip

288 messages · Page 1 of 1 (latest)

covert marsh
#

If i equip my knife, then unequip it, i can still hit people with empty hand, my code is that :

local cas = game:GetService("ContextActionService")
local rs = game:GetService("ReplicatedStorage")

local events = rs:WaitForChild("Events")
local hitboxEvent = events:WaitForChild("Hitbox")

local plr = game.Players.LocalPlayer
local character = plr.Character or plr.CharacterAdded:Wait()
local hum = character:WaitForChild("Humanoid")
local animator = hum:WaitForChild("Animator")

local leftSwing = animator:LoadAnimation(script:WaitForChild("LeftSwing"))
local rightSwing = animator:LoadAnimation(script:WaitForChild("RightSwing"))

local currentSwing = 0
local lastSwing = 0

local debounce = false

local function swing()
    if debounce then return end
    if not character:FindFirstChild("Knife") then return end
    if tick() - lastSwing > 1.5 then
        currentSwing = 0
    end

    debounce = true
    if currentSwing == 0 then
        rightSwing:Play()
        hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 20, 140)
        task.wait(0.4)
        debounce = false
    elseif currentSwing == 1 then
        leftSwing:Play()
        hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 20, 140)
        task.wait(0.4)
        debounce = false
    elseif currentSwing == 2 then
        rightSwing:Play()
        hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 20, 140)
        task.wait(0.8)
        debounce = false
    end
    if currentSwing == 2 then
        currentSwing = 0
    else
        currentSwing += 1
    end
    lastSwing = tick()
end

cas:BindAction("Swing", swing, true, Enum.UserInputType.MouseButton1)
timber summit
timber summit
#

The knife is a tool right?

covert marsh
timber summit
#

I would just connect the swing function to the tool.Activated signal

#

Which happens when u click the function with mouse 1 whole it's equipped

#
local tool = script.Parent

local function explode(point)
    local e = Instance.new("Explosion")
    e.DestroyJointRadiusPercent = 0 -- Make the explosion non-deadly
    e.Position = point
    e.Parent = workspace
end

local function onActivated()
    -- Get the Humanoid that Activated the tool
    local human = tool.Parent.Humanoid
    -- Call explode with the current point the Humanoid is targetting
    explode(human.TargetPoint)
end

tool.Activated:Connect(onActivated)
#

Example from the documentation

#

So the swing function would be connected to the activated signal

covert marsh
timber summit
#

Look at the example

covert marsh
#

Yeah but i didnt understand

timber summit
#

You have your swing function

#

Can you reference your tool the knife as a variable first

#

So

covert marsh
#

if tool.?

true socketBOT
#

studio** You are now Level 1! **studio

timber summit
#

No

covert marsh
#

oh

timber summit
#

Where's your tool

#

Reference it

covert marsh
#

StarterPack.Knife

timber summit
#

Ok

#

is the script inside the knife?

covert marsh
#

Yep

timber summit
#

So script.Parent is the knife

#

So first we define knife

#
local knife = script.Parent
#

Then we can do

#
knife.Activated:Connect(swing)
#

To replace the cas binding

covert marsh
#

oh uh

#

Most likely?

timber summit
#

No

#

Ok

#

define knife

covert marsh
#

if knife.Activated:Connect(swing)

#

?

timber summit
#

At line one

covert marsh
#

sure

timber summit
#

Then connect the function outside of the swing function

#

Like after ir

covert marsh
timber summit
#

Nice

#

Yes

#

Then connect the function at the last line

#

And delete the cas binding

covert marsh
#

oh

#

im confused

timber summit
#

Nvm fuck it

#

Gimme a second

covert marsh
#

Sorry if i am asking too much questions

timber summit
#

If i equip my knife, then unequip it, i can still hit people with empty hand, my code is that :

local knife =script.Parent 
local cas = game:GetService("ContextActionService")
local rs = game:GetService("ReplicatedStorage")

local events = rs:WaitForChild("Events")
local hitboxEvent = events:WaitForChild("Hitbox")

local plr = game.Players.LocalPlayer
local character = plr.Character or plr.CharacterAdded:Wait()
local hum = character:WaitForChild("Humanoid")
local animator = hum:WaitForChild("Animator")

local leftSwing = animator:LoadAnimation(script:WaitForChild("LeftSwing"))
local rightSwing = animator:LoadAnimation(script:WaitForChild("RightSwing"))

local currentSwing = 0
local lastSwing = 0

local debounce = false

local function swing()
    if debounce then return end
    if not character:FindFirstChild("Knife") then return end
    if tick() - lastSwing > 1.5 then
        currentSwing = 0
    end

    debounce = true
    if currentSwing == 0 then
        rightSwing:Play()
        hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 20, 140)
        task.wait(0.4)
        debounce = false
    elseif currentSwing == 1 then
        leftSwing:Play()
        hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 20, 140)
        task.wait(0.4)
        debounce = false
    elseif currentSwing == 2 then
        rightSwing:Play()
        hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 20, 140)
        task.wait(0.8)
        debounce = false
    end
    if currentSwing == 2 then
        currentSwing = 0
    else
        currentSwing += 1
    end
    lastSwing = tick()
end

knife.Activated:Connect(swing) 
#

Copy and paste the script

#

Did it work?

covert marsh
#

Can i know what u change btw

timber summit
#

Defining knife in line 1

#

Connecting the func to activated at the last line

#

Deleting the cas binding

#

Did it work tho

covert marsh
#

no it didnt

timber summit
#

Well what's the error

covert marsh
#

Rendering is paused for debugging

timber summit
#

Bruh

#

Remove the breakpoint

#

Click on the red dot

#

On line 2

#

That u accidentally activated ig

covert marsh
#

Oh

#

My bad

#

But it still not works

#

I can still hit

#

Let me show the console

#

Console is empty

timber summit
#

Wdym

#

You can still hit

#

Try unequipping the tool

#

And u won't be able to hit

#

Anyway the console should be empty

#

If there's no errors

#

And u don't print anything

#

Uh

#

I gtg soon

#

So did it work?

covert marsh
#

It did not work

#

Basically it works same as the first code i gave you

timber summit
#

Uh

#

Under activated

#

insert the line

#
knife.Unequipped:Connect(function()
debounce = true
end)
true socketBOT
#

studio** You are now Level 11! **studio

timber summit
#
knife.Equipped:Connect(function()
debounce = false
end)
#

And this under that

covert marsh
#

let me see

true socketBOT
#

studio** You are now Level 2! **studio

covert marsh
#

wait where to put that?

#

at the last line?

#

if its the last usage i can still hit after equip @timber summit

timber summit
#

Wait

#

Are u even editing the right scripr

covert marsh
#

Yeah

timber summit
#

Uh

covert marsh
#

Cant we have a better code?

#

People say that code is trash

timber summit
#

What code

covert marsh
#

That knife code

#

3 Combo

#

Knockback

timber summit
#

Wdym u made the code

#

Right?

covert marsh
#

No

#

Its a tutorial

#

Hello there! This is a tutorial on how to make a fully functioning punch script which can be used in fighting game. Let me know if you want to see a part 2 where are add stun or knockback!

Songs:

  1. Stickerbrush Symphony by Michiko Naruke
  2. Lofi hip hop lofi by Enokido
  3. Lofi 2 by JamaBeats

Pastebin: https://pastebin.com/npTq5cS2

Join the D...

▶ Play video
#

Make sure to watch this tutorial first: https://youtu.be/xWBdW2JvHnM
All this video is is adding the knockback to the final punch of the m1 combo. Like And Subscibe!

0:00 Intro
0:10 Coding
1:52 Tweeking Knockback
2:29 Final Knockback
2:57 Outro

Pastebin: https://pastebin.com/mYzP55rK
Discord: https://discord.gg/nDpzYmC6Vm

Songs:

  1. The Great ...
▶ Play video
timber summit
#

Well u didn't finish it probably

covert marsh
#

i did complete the entire tutorial

#

theres one more script

#

local rs = game:GetService("ReplicatedStorage")
local ts = game:GetService("TweenService")

local kbtween = TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)

local events = rs:WaitForChild("Events")
local hitboxEvent = events:WaitForChild("Hitbox")

function knockback(victim, character, power)
local ehrp = victim.HumanoidRootPart
local uhrp = character.HumanoidRootPart

local att = Instance.new("Attachment", ehrp)
local lv = Instance.new("LinearVelocity", att)

lv.MaxForce = 9999999
lv.Attachment0 = att

local lookVector = uhrp.CFrame.LookVector
lv.VectorVelocity = lookVector * power

local tween = ts:Create(lv, kbtween, {VectorVelocity = lookVector * 0.1})
tween:Play()
game.Debris:AddItem(att, 0.3)

end

function newHitbox(character, size, offset, damage, linger, kb)
local hrp = character:FindFirstChild("HumanoidRootPart")
if hrp == nil then return end
local weld = Instance.new("WeldConstraint", hrp)
local hitbox = Instance.new("Part")
weld.Part0 = hrp
weld.Part1 = hitbox

hitbox.Transparency = 1
hitbox.CanCollide = false
hitbox.CanQuery = false
hitbox.Massless = true

hitbox.Size = size
hitbox.CFrame = hrp.CFrame + hrp.CFrame.LookVector * offset.X + Vector3.new(0,offset.Y)
hitbox.Parent = character

hitbox.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") == nil then return end

    for _, v in pairs(hitbox:GetChildren()) do
        if v:IsA("ObjectValue") then
            if v.Value == hit.Parent then return end
        end
    end

    local hitCounter = Instance.new("ObjectValue", hitbox)
    hitCounter.Value = hit.Parent

    hit.Parent.Humanoid:TakeDamage(1000)

    if kb <= 0 then return end
    knockback(hit.Parent, character, kb)
end)

game.Debris:AddItem(hitbox, linger)

end

hitboxEvent.OnServerEvent:Connect(function(plr, size, offset, damage, linger, kb)
newHitbox(plr.Character, size, offset, damage, linger, kb)
end)

#

its for hitbox

#

in serverscriptservice

timber summit
#

His code I meant to work for a damn gui

#

It's meant to be a punch

#

Which means it's meant to work regardless of what you're holding

covert marsh
#

Uh

#

Yeah...

#

Well i was only want a knockback, i searched a lot and a lot and a lot but i cannot find a one, so i decided to implement a punch tutorial into that knife

#

I use chatgpt, devforum, youtube, hiddendevs

#

I was cant find

timber summit
#

Ok

covert marsh
#

So that script is the only way

timber summit
#

Delete all your script tabs

covert marsh
#

Yeah

timber summit
#

Not the text

#

Just press x

#

On the tabs

covert marsh
#

Okey i did

timber summit
#

Except for the game tab

#

Then

#

Click the local script again

covert marsh
#

Yes

timber summit
#

What does the last line say

covert marsh
timber summit
#

Wait delete the activated line

#

And try

covert marsh
#

What do you mean

timber summit
#

See if it still hits

#

Delete line 53

covert marsh
#

Oh delete line 53 you mean

timber summit
#

And try the game again

covert marsh
#

Nope

#

It doesnt work

timber summit
#

So it does it still ragdoll

covert marsh
#

Ragdoll is a different script

#

Dont worry about it

timber summit
#

Yea but

covert marsh
#

But knife not hitting now

timber summit
#

Ok

#

Yea that's the point

covert marsh
#

Animations, system, hit everything is gone

timber summit
#

Put back the line

covert marsh
#

Yes

timber summit
#

Nvm just send me a video of the error

#

Like send me a video of the thing failing

covert marsh
#

Theres no fail

#

Script just not works anymore

#

After i delete line 53

timber summit
#

Yea

#

But back line 53

#

Put*

#

And then it'll work

covert marsh
#

You have time? i need to use bathroom, let me do it when i back

#

If u can wait 15 mins

timber summit
#

Nah

covert marsh
#

Oh

timber summit
#

I gtg

#

In 10

covert marsh
#

If its even work

#

people saying disable unbind

#

or smt like that

timber summit
#

Yea

#

But

covert marsh
#

but how

timber summit
#

Uh

#

OK let's just try the original

covert marsh
#

Your able to make that knife work for NOT gui

timber summit
#

If i equip my knife, then unequip it, i can still hit people with empty hand, my code is that :

local cas = game:GetService("ContextActionService")
local rs = game:GetService("ReplicatedStorage")

local events = rs:WaitForChild("Events")
local hitboxEvent = events:WaitForChild("Hitbox")

local plr = game.Players.LocalPlayer
local character = plr.Character or plr.CharacterAdded:Wait()
local hum = character:WaitForChild("Humanoid")
local animator = hum:WaitForChild("Animator")

local leftSwing = animator:LoadAnimation(script:WaitForChild("LeftSwing"))
local rightSwing = animator:LoadAnimation(script:WaitForChild("RightSwing"))

local currentSwing = 0
local lastSwing = 0

local debounce = false

local function swing()
    if debounce then return end
    if not character:FindFirstChild("Knife") then return end
    if tick() - lastSwing > 1.5 then
        currentSwing = 0
    end

    debounce = true
    if currentSwing == 0 then
        rightSwing:Play()
        hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 20, 140)
        task.wait(0.4)
        debounce = false
    elseif currentSwing == 1 then
        leftSwing:Play()
        hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 20, 140)
        task.wait(0.4)
        debounce = false
    elseif currentSwing == 2 then
        rightSwing:Play()
        hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 20, 140)
        task.wait(0.8)
        debounce = false
    end
    if currentSwing == 2 then
        currentSwing = 0
    else
        currentSwing += 1
    end
    lastSwing = tick()
end

tool.Equipped:Connect(function()
    ContextActionService:BindAction("Swing" , swing, true, Enum.KeyCode.MouseButton1)
end)

tool.Unequipped:Connect(function()
    ContextActionService:UnbindAction("Swing" )
end) 
#

Try this

covert marsh
true socketBOT
#

studio** You are now Level 3! **studio

timber summit
#

Sorry

#

If i equip my knife, then unequip it, i can still hit people with empty hand, my code is that :

local knife = script.Parent 
local cas = game:GetService("ContextActionService")
local rs = game:GetService("ReplicatedStorage")

local events = rs:WaitForChild("Events")
local hitboxEvent = events:WaitForChild("Hitbox")

local plr = game.Players.LocalPlayer
local character = plr.Character or plr.CharacterAdded:Wait()
local hum = character:WaitForChild("Humanoid")
local animator = hum:WaitForChild("Animator")

local leftSwing = animator:LoadAnimation(script:WaitForChild("LeftSwing"))
local rightSwing = animator:LoadAnimation(script:WaitForChild("RightSwing"))

local currentSwing = 0
local lastSwing = 0

local debounce = false

local function swing()
    if debounce then return end
    if not character:FindFirstChild("Knife") then return end
    if tick() - lastSwing > 1.5 then
        currentSwing = 0
    end

    debounce = true
    if currentSwing == 0 then
        rightSwing:Play()
        hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 20, 140)
        task.wait(0.4)
        debounce = false
    elseif currentSwing == 1 then
        leftSwing:Play()
        hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 20, 140)
        task.wait(0.4)
        debounce = false
    elseif currentSwing == 2 then
        rightSwing:Play()
        hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 20, 140)
        task.wait(0.8)
        debounce = false
    end
    if currentSwing == 2 then
        currentSwing = 0
    else
        currentSwing += 1
    end
    lastSwing = tick()
end

knife.Equipped:Connect(function()
    ContextActionService:BindAction("Swing" , swing, true, Enum.KeyCode.MouseButton1)
end)

knife.Unequipped:Connect(function()
    ContextActionService:UnbindAction("Swing" )
end) 
#

Again

#

Paste this

#

Also define knife at line 1

#

I forgot to add in

covert marsh
covert marsh
timber summit
#

Yea

#

This should work

covert marsh
#

...

timber summit
#

If i equip my knife, then unequip it, i can still hit people with empty hand, my code is that :

local knife = script.Parent 
local cas = game:GetService("ContextActionService")
local rs = game:GetService("ReplicatedStorage")

local events = rs:WaitForChild("Events")
local hitboxEvent = events:WaitForChild("Hitbox")

local plr = game.Players.LocalPlayer
local character = plr.Character or plr.CharacterAdded:Wait()
local hum = character:WaitForChild("Humanoid")
local animator = hum:WaitForChild("Animator")

local leftSwing = animator:LoadAnimation(script:WaitForChild("LeftSwing"))
local rightSwing = animator:LoadAnimation(script:WaitForChild("RightSwing"))

local currentSwing = 0
local lastSwing = 0

local debounce = false

local function swing()
    if debounce then return end
    if not character:FindFirstChild("Knife") then return end
    if tick() - lastSwing > 1.5 then
        currentSwing = 0
    end

    debounce = true
    if currentSwing == 0 then
        rightSwing:Play()
        hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 20, 140)
        task.wait(0.4)
        debounce = false
    elseif currentSwing == 1 then
        leftSwing:Play()
        hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 20, 140)
        task.wait(0.4)
        debounce = false
    elseif currentSwing == 2 then
        rightSwing:Play()
        hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 20, 140)
        task.wait(0.8)
        debounce = false
    end
    if currentSwing == 2 then
        currentSwing = 0
    else
        currentSwing += 1
    end
    lastSwing = tick()
end

knife.Equipped:Connect(function()
    ContextActionService:BindAction("Swing" , swing, true, Enum.UserInputType.MouseButton1)
end)

knife.Unequipped:Connect(function()
    ContextActionService:UnbindAction("Swing" )
end) 
#

Yea last copy and paste I think

covert marsh
#

dont mind playing run

#

its from different tutorial related to acceleration

timber summit
#

Oh

#

If i equip my knife, then unequip it, i can still hit people with empty hand, my code is that :

local knife = script.Parent 
local ContextActionService= game:GetService("ContextActionService")
local rs = game:GetService("ReplicatedStorage")

local events = rs:WaitForChild("Events")
local hitboxEvent = events:WaitForChild("Hitbox")

local plr = game.Players.LocalPlayer
local character = plr.Character or plr.CharacterAdded:Wait()
local hum = character:WaitForChild("Humanoid")
local animator = hum:WaitForChild("Animator")

local leftSwing = animator:LoadAnimation(script:WaitForChild("LeftSwing"))
local rightSwing = animator:LoadAnimation(script:WaitForChild("RightSwing"))

local currentSwing = 0
local lastSwing = 0

local debounce = false

local function swing()
    if debounce then return end
    if not character:FindFirstChild("Knife") then return end
    if tick() - lastSwing > 1.5 then
        currentSwing = 0
    end

    debounce = true
    if currentSwing == 0 then
        rightSwing:Play()
        hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 20, 140)
        task.wait(0.4)
        debounce = false
    elseif currentSwing == 1 then
        leftSwing:Play()
        hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 20, 140)
        task.wait(0.4)
        debounce = false
    elseif currentSwing == 2 then
        rightSwing:Play()
        hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 20, 140)
        task.wait(0.8)
        debounce = false
    end
    if currentSwing == 2 then
        currentSwing = 0
    else
        currentSwing += 1
    end
    lastSwing = tick()
end

knife.Equipped:Connect(function()
    ContextActionService:BindAction("Swing" , swing, true, Enum.UserInputType.MouseButton1)
end)

knife.Unequipped:Connect(function()
    ContextActionService:UnbindAction("Swing" )
end) 
#

Try this

covert marsh
#

No.

#

Theres no error but its not works

timber summit
#

Nvm gtg bye

covert marsh
#

Bye see you later, thank you for trying to help.

#

You just waste time on my weird script others was not even doing that and saying "go learn lua and fix your own problem" bruh.

timber summit
#

Like build your way up

covert marsh
#

Im not rlly interested in scripting

timber summit
#

Dont just copy stuff u don't know the meaning of

covert marsh
#

I dont even have time

timber summit
#

Oh

#

Ok

#

Then uh

#

Give a scripter a job

covert marsh
#

WOW!?

#

IS THAT SERVER GOT ACHIEVEMENTS.

timber summit
#

Yea

covert marsh
#

IM HERE TILL I FAINT

#

I got addiction into achievements 😶

timber summit
#

Lol

covert marsh
#

xd

timber summit
#

OK gtg bye

covert marsh
#

Bye

covert marsh
#

@timber summit

#

so i made a script with UserInputService

#

Pretty much new knife

#

But now it only works on dummys

#

Not me

#

If i delete every dummy from workspace then it works for me

#

Also it looks for only single dummy not every

#
local UIS = game:GetService("UserInputService")
local LeftPunch = true
local RightPunch = false
local AnimationInProgress = false
local KnifeEvent = game.ReplicatedStorage:WaitForChild("KnifeEvent")

local function Swing()
    if AnimationInProgress then
        return
    end
    
    AnimationInProgress = true
    
    if LeftPunch then
        LeftPunch = false
        RightPunch = true
        KnifeEvent:FireServer("LeftPunch")
    else
        LeftPunch = true
        RightPunch = false
        KnifeEvent:FireServer("RightPunch")
    end
    
    wait(0.5)
    AnimationInProgress = false
end

function Clicked(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 and AnimationInProgress == false then
        Swing()
    end
end
UIS.InputBegan:Connect(Clicked)
#
local KnifeEvent = game.ReplicatedStorage:WaitForChild("KnifeEvent")
local TS = game:GetService("TweenService")
local SS = game:GetService("SoundService")

local LeftPunchAnimation = Instance.new("Animation")
LeftPunchAnimation.AnimationId = "rbxassetid://14754874269"

local RightPunchAnimation = Instance.new("Animation")
RightPunchAnimation.AnimationId = "rbxassetid://14754821773"

local PlayersWhoCanDamage = {}

local function loadAnimation(Humanoid, Animation)
    local  AnimationTrack = Humanoid:LoadAnimation(Animation)
    AnimationTrack:Play()
    SS["Knife Sound Effect"]:Play()
end

local function DamageHandler(Character, CharacterToDamage)
    if table.find(PlayersWhoCanDamage, Character.Name) then
        table.remove(PlayersWhoCanDamage, table.find(PlayersWhoCanDamage, Character.Name))
        
        SS["Knife Sound Effect"]:Stop()
        SS["DBZ Knife Sound"]:Stop()
        CharacterToDamage.Humanoid.Health -= 9999
        SS["DBZ Knife Sound"]:Play()
        
        for i,v in pairs(CharacterToDamage:GetChildren()) do
            if v:IsA("MeshPart") then
                local Tween = TS:Create(v, TweenInfo.new(0.4, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {Color = Color3.new(1, 0, 0), Transparency = 0.5})
                Tween:Play()
            end
        end

        wait(0.1)

           for i,v in pairs(CharacterToDamage:GetChildren()) do
        if v:IsA("MeshPart") then
                local Tween = TS:Create(v, TweenInfo.new(0.4, Enum.EasingStyle.Linear, Enum.EasingDirection.In), {Color = Color3.new(0.6, 0.6, 0.6), Transparency = 0})
            Tween:Play()
        end
    end
  end
end




KnifeEvent.OnServerEvent:Connect(function(plr, attackType)
    local Character = game.Workspace:FindFirstChild(plr.Name)
    
    if Character then
        local Humanoid = Character:FindFirstChild("Humanoid")
        
        if Humanoid then
            if attackType == "LeftPunch" then
                loadAnimation(Humanoid, LeftPunchAnimation)
                table.insert(PlayersWhoCanDamage, plr.Name)
                
                Character["Left Arm"].Touched:Connect(function(hit)
                    local CharacterToDamage = hit.Parent
                    local HumanoidToDamage = CharacterToDamage:FindFirstChild("Humanoid")
                    
                    if HumanoidToDamage then
                        DamageHandler(Character, CharacterToDamage)
                    end
                end)
                
                wait(0.4)
                if table.find(PlayersWhoCanDamage, plr.Name) then
                    table.remove(PlayersWhoCanDamage, table.find(PlayersWhoCanDamage, plr.Name))
                end
            elseif attackType == "RightPunch" then
                loadAnimation(Humanoid, RightPunchAnimation)
                table.insert(PlayersWhoCanDamage, plr.Name)
                
                Character["Right Arm"].Touched:Connect(function(hit)
                    local CharacterToDamage = hit.Parent
                    local HumanoidToDamage = CharacterToDamage:FindFirstChild("Humanoid")
                    
                    if HumanoidToDamage then
                        DamageHandler(Character, CharacterToDamage)
                    end
                end)
                
                wait(0.4)
                if table.find(PlayersWhoCanDamage, plr.Name) then
                    table.remove(PlayersWhoCanDamage, table.find(PlayersWhoCanDamage, plr.Name))
                    
                end
            end
        end
    end
end)
timber summit
covert marsh
#

Unless i delete all dummys i cant use the tool

covert marsh
#

UIS is ANNOYING!!!

timber summit
#

Idk

#

Idk how this is failing rn

covert marsh
#

CAS its more annoying tbh but better than UIS for now

covert marsh
#

Its made for gui

timber summit
#

Yea

covert marsh
#

You know how to rewrite?

timber summit
#

I'm on my phone rn

#

Maybe later

covert marsh
#

Oh

#

Sure

covert marsh
#

HEY

#

@timber summit

#

I FOUND SMT

#
local Turn = 1
local Damage = 9999
local Cooldown = 0.03
--END

script.Parent.Activated:Connect(function()
    if script.Parent.Cooldown.Value == false then
        script.Parent.Cooldown.Value = true
        script.Parent.CanDamage.Value = true

        local Humanoid = script.Parent.Parent.Humanoid
        local Anim1 = Humanoid:LoadAnimation(script.Parent.Attack1)
        local Anim2 = Humanoid:LoadAnimation(script.Parent.Attack2)


        if Turn == 1 then
            Anim1:Play()
            Turn = 2

            Anim1.Stopped:wait(Cooldown)
            script.Parent.CanDamage.Value = false
            script.Parent.Cooldown.Value = false

        elseif Turn == 2 then
            Anim2:Play()
            Turn = 1

            Anim2.Stopped:Wait(Cooldown)
            script.Parent.CanDamage.Value = false
            script.Parent.Cooldown.Value = false
        end
    else
        return
    end
end)

script.Parent.Handle.Touched:Connect(function(Hit)
    if Hit.Parent:FindFirstChild("Humanoid") then
        local Humanoid = Hit.Parent.Humanoid

        if script.Parent.CanDamage.Value == true then
            Humanoid:TakeDamage(Damage)
            script.Parent.CanDamage.Value = false
        else
            return
        end
    else
        return
    end
end)
#

A pretty much new code that works so good

#

Also no hitbox, its only works in some way idk how too xD

#

but i need knockback for it

#

you know how to add?

timber summit
#

U gonna have to do a client - >server->client

#

Thing cuz the network owner of the character is it's player

timber summit
#

It's kinda complicated

#

I made a post for something similar before

#

And somebody posted their answer

#

I'll see if I can find that

#

Nvm can't find it

#

Basically fire a remote event from the client to the server