#3 Punch combo like those battle ground games

71 messages · Page 1 of 1 (latest)

tepid flame
#

can someone help my friend make a 3 punch combo I have the animations made
Dm @high forum

wheat haloBOT
#

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

candid canyon
#

yo

#

u ever heard

#

smh called

#

google? or youtube?

tepid flame
#

nah

candid canyon
#

dam.

tepid flame
#

yeah

#

so you gon help

candid canyon
#

idk

tepid flame
#

since you know about google n youtube

candid canyon
tepid flame
#

that isnt

candid canyon
#

m

#

hm

tepid flame
#

what we tryna do

#

its like those battleground games

#

3 punches all the punches are different

candid canyon
#

its a idea

#

oh wait

tepid flame
#

the one youtube video we found had no script

candid canyon
#

i got it

#

so

#

make a screen

#

gui

#

in localscript

#

aight?

tepid flame
#

aight

#

then

candid canyon
#

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 leftPunch = animator:LoadAnimation(script:WaitForChild("LeftPunch"))
local rightPunch = animator:LoadAnimation(script:WaitForChild("RightPunch"))

local currentPunch = 0
local lastPunch = 0

local debounce = false

local function punch()
if debounce then return end
if tick() - lastPunch > 1.5 then
currentPunch = 0
end

debounce = true
if currentPunch == 0 then
    rightPunch:Play()
    hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 0.3)
    task.wait(0.4)
    debounce = false
elseif currentPunch == 1 then
    leftPunch:Play()
    hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 0.3)
    task.wait(0.4)
    debounce = false
elseif currentPunch == 2 then
    rightPunch:Play()
    hitboxEvent:FireServer(Vector3.new(3,3,3), Vector3.new(2), 10, 0.3)
    task.wait(0.8)
    debounce = false
end
if currentPunch == 2 then
    currentPunch = 0
else
    currentPunch += 1
end
lastPunch = tick()

end

cas:BindAction("Punch", punch, true, Enum.UserInputType.MouseButton1)

#

in the local script

#

make left punch

#

right punch

#

animation

#

done

tepid flame
#

there are 3 punches tho

candid canyon
#

add it

tepid flame
#

aight

candid canyon
#

oh ai

tepid flame
#

appreciate it

#

ion know how to code im just helping @high forum

candid canyon
#

then ai

#

battle ground games have 4 punches i think

tepid flame
#

he wants 3 tho

candid canyon
#

ok then ai

#

use assistam

#

in roblox studio

#

thats better

#

or chatgpt

#

idk

high forum
#

hi

candid canyon
#

done

high forum
#

does this include hitboxes, dmg and other things or just the punches?

candid canyon
#

ye mine does

#

oh wait

#

i forgor smh

candid canyon
#

server script
local rs = game:GetService("ReplicatedStorage")

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

function newHitbox(character, size, offset, damage, linger)
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(damage)
end)

game.Debris:AddItem(hitbox, linger)

end

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

#

mb

#

mine

candid canyon
#

in server scirpt

#

service

high forum
#

k

candid canyon
#

Name it hitbox

#

but it got 2 punches

#

change it or ai

high forum
#

na thas fine I just wanna see if it works then I can make edits