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
-- 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
defenderData.health -= damage
-- Check knockout if defenderData.health <= 0 then matchActive = false -- award win to attacker attackerData.wins += 1 defenderData.losses += 1 for _, p in pairs(playersInMatch) do remotes.updateUI:FireClient(p, {result = attacker.Name .. " wins!"}) end -- end match, return players to lobby end end
-- Styles data local styles = { Outboxer = { health = 100, stamina = 120, punchDamage = 10, speed = 1.2, special = "Jab Storm", specialDamage = 30 }, Slugger = { health = 120, stamina = 100, punchDamage = 15, speed = 0.9, special = "Haymaker", specialDamage = 45 }, Swarmer = { health = 90, stamina = 140, punchDamage = 8, speed = 1.4, special = "Body Blows", specialDamage = 25 } } Script Untitled Boxing Game
for _, remote in pairs(remotes) do remote.Parent = ReplicatedStorage end
-- Stamina cost local staminaCost = 10 if attackerData.stamina < staminaCost then return end attackerData.stamina -= staminaCost p in pairs(playersInMatch) do remotes.updateUI:FireClient(p
remotes.dodge.OnServerEvent:Connect(function(player) -- reduce incoming damage for next 0.5 sec end)