#Punches are slower when I hit a player?

1 messages · Page 1 of 1 (latest)

pearl plaza
#

Code:

                     for i, v in pairs(createHitbox) do
            if v.Parent:FindFirstChild("Humanoid") and not humsHit[v.Parent.Name] and v.Parent ~= char then
                local distance = (char:FindFirstChild("HumanoidRootPart").Position - v.Position).Magnitude
                
                if distance <= 4 then
                    
                    local isParrying = stateManagerRF:InvokeServer(v.Parent, "Parrying")
                    
                    if isParrying == false then
                        humsHit[v.Parent.Name] = true
                    
                        damageRF:InvokeServer(v.Parent, currentM1)
                    
                        if currentM1 == 4 then
                            knockbackRF:InvokeServer(v.Parent, 1)
                        else
                            knockbackRF:InvokeServer(v.Parent)
                        end
                        
                        break
                        
                    elseif isParrying == true then
                        
                        m1Track:Stop()
                        
                        hum.WalkSpeed = 5
                        task.wait(2)
                        hum.WalkSpeed = 16
                        
                        break
                        
                    end
                    
                end
            end
        end
        
        task.spawn(function()  -- to reset the m1s
            
            local oldM1sPerformed = m1sPerformed
            
            task.wait(waitBeforeReset)
            
            if oldM1sPerformed == m1sPerformed then
                
                currentM1 = 0 -- reset m1 combo
                
            end
            
        end)
        
        if currentM1 == 4 then -- check if performed last m1
            
            task.wait(comboEndCooldown)
            
            currentM1 = 0 -- reset
        end
        
        task.wait(m1Track.Length)
        
        
        m1Debounce = false
        
    end
end
lilac void
#

you don't need to use them

pearl plaza
lilac void
#

just do

for i, v in createHitbox do
#

btw, remote functions are slow

#

and creating objects

pearl plaza
lilac void
#

you NEVER want the client to do important processes.

pearl plaza