#Problem with a M1

1 messages · Page 1 of 1 (latest)

untold lance
#

guys, i have a problem, in the local or server script, idk tbh
When I spawn as my character, all M1 attacks slowly not laggy, just slow,
But after the M1 combo resets, everything works perfectly fast.
What could be the issue?

local script:
local UIS = game:GetService("UserInputService")

local CharacterHN = require(game:GetService("ReplicatedStorage").CharacterHandler)

local Players = game:GetService("Players")

local player = Players.LocalPlayer

local character = player.Character or player.CharacterAdded:Wait()

--| Tanya |-----------------------------------------------------------------------------------

local TanyaM1 = game.ReplicatedStorage.Characters.Tanya.Events.M1
local TanyaM1End = game.ReplicatedStorage.Characters.Tanya.Events.M1End

local TanyaM1Count = 0

local TanyaAnimPlaying = false

local TanyaM1Debounce = false

local function Debounce()

TanyaM1Debounce  = true

task.delay(1.5, function()
    
    TanyaM1Debounce = false
    
end)

end

local function M1Count()

TanyaM1Count += 1

if TanyaM1Count > 3 then

    TanyaM1Count = 0

    Debounce()

end

end

UIS.InputBegan:Connect(function(input)

if TanyaAnimPlaying or TanyaM1Debounce then return end

local humanoid = character:FindFirstChild("Humanoid")
if not humanoid or humanoid.Health <= 0 then return end

--M1

if input.UserInputType == Enum.UserInputType.MouseButton1 and player:GetAttribute("Tanya") then
    
    TanyaAnimPlaying = true
    
    TanyaM1:FireServer(TanyaM1Count)
    
    M1Count()
    
end


--------
--Skills

end)

TanyaM1End.OnClientEvent:Connect(function()

TanyaAnimPlaying = false

end)

#

plz help