Script Untitled Boxing — Game

-- Helper: find opponent local function getOpponent(player) for _, p in pairs(playersInMatch) do if p ~= player then return p end end return nil end

local attackerData = playerStats[attacker] local defenderData = playerStats[opponent]

-- Update UI remotes.updateUI:FireClient(opponent, {health = defenderData.health, stamina = defenderData.stamina}) remotes.updateUI:FireClient(attacker, {health = attackerData.health, stamina = attackerData.stamina}) Script Untitled Boxing Game

-- Punch logic local function handlePunch(attacker, punchType) local opponent = getOpponent(attacker) if not opponent or not matchActive then return end

remotes.dodge.OnServerEvent:Connect(function(player) -- reduce incoming damage for next 0.5 sec end) {health = defenderData.health

for _, remote in pairs(remotes) do remote.Parent = ReplicatedStorage end

-- Defense check (client would send block/dodge state) -- For simplicity, assume opponent blocking reduces damage by 50% local isBlocking = false -- would be set by remote event if isBlocking then damage = damage * 0.5 end {health = attackerData.health

-- Base damage by punch type local damage = attackerData.style.punchDamage if punchType == "Hook" then damage = damage * 1.2 elseif punchType == "Uppercut" then damage = damage * 1.3 end