#I'm trying to learn to script and I need help with M1's

1 messages · Page 1 of 1 (latest)

feral pine
#

Ive always wanted to make my own fighting game in roblox and so I've watched a tutorial on how to make m1's in studio. I followed the steps and used the code he said to use while also looking it up to understand it. However when I finished scripting and loaded into test it wouldn't work. I've tried multiple times and I can't find any errors. If anyone's willing to help should I send both the script from the video and my script?

brisk thunder
feral pine
feral pine
# brisk thunder

Input manager code:local plrs = game:GetService("Players")
local lp = plrs.LocalPlayer
local mouse = lp:GetMouse()

local m1Script = script.WaitForChild("M1")
local m1BF = m1Script:WaitForChild("Function")

mouse.Button1Down:Connect(function()

m1BF:Invoke()

end)

#

then for the m1's

#

local bindableFunction = script:WaitForChild("Function")

local rs = game:GetService("ReplicatedStorage")
local rsAnimationsFolder = rs:WaitForChild("Animations")

local plrs = game:GetService("Players")
local lp = plrs.LocalPlayer
local char = lp.Character or lp.CharacterAppearanceLoaded:Wait()
local hum = char:WaitForChild("Humanoid")
local animator = hum:WaitForChild("Animator")

local m1sPerformed = 0

local currentM1 = 0

local m1Debounce = false

local comboEndCooldown = 2

local waitBeforeReset = 0.5

bindableFunction.OnInvoke = function()

if not m1Debounce then

    m1Debounce = true

    m1sPerformed += 1
    currentM1 += 1

    local correspondingM1anim = rsAnimationsFolder:FindFirstChild("M1 ("..currentM1..")")

    local m1Track = animator:LoadAnimation(correspondingM1anim)

    m1Track:Play()

    task.wait(m1Track.Length - 0.1)

    task.spawn(function()

        local oldM1sPerformed = m1sPerformed

        task.wait(waitBeforeReset)

        if oldM1sPerformed == m1sPerformed then

            currentM1 = 0

        end

    end)

    if currentM1 == 4 then

        task.wait(comboEndCooldown)

        currentM1 = 0

    end

    m1Debounce = false

end

end

#

@brisk thunder lemme know if you can help 🙏