โš”๏ธ My First Roblox Studio Game ยท Episode 4 of 6 ยท See All Episodes
โš”๏ธ Episode 4 ยท Multiplayer ยท Tools ยท Leaderboard

Sword Fight!
Battle Arena

Build a multiplayer sword fight arena โ€” players battle each other, kills appear on a leaderboard, and you can pick up different weapons from a shop!

๐Ÿ‘ถ Ages 8+ โฑ๏ธ ~2 Hours ๐ŸŸฆ Roblox Studio โœ“ Free
โญ
0 XP
Level 1
๐Ÿ”ฅ0
Your Progress0 / 12 steps
1
๐ŸŸ๏ธ
Build the Arena
Create a coliseum-style battle arena with walls and cover
Active
๐ŸŽฏ
Goal for this step

Build an enclosed battle arena with a dramatic dark stone look.

๐Ÿ‘จโ€๐Ÿ‘ง
Parent note: Open Roblox Studio โ†’ Baseplate template. This episode is great for kids who love Roblox combat games they'll learn how health, tools and leaderboards work!
  • 1Delete the default Baseplate. Add a flat Part size 80, 1, 80, BrickColor Dark stone grey, Material Cobblestone. Name it ArenaFloor.
  • 2Add 4 wall parts around it (size 80, 12, 2 for front/back, 2, 12, 80 for sides). BrickColor Medium stone grey, Material Brick. All Anchored = true.
  • 3Add 6 pillar parts (size 2, 14, 2) around the inside of the walls for cover to hide behind. BrickColor Dark stone grey.
  • 4Add 4 SpawnLocations spread around the arena so players start in different corners.
  • 5In Lighting, set Ambient to a dark red-orange. Add a PointLight to a central pillar with orange colour and Range 40 for dramatic battle lighting.
๐Ÿ”ข
Put It In Order
+15 XP
Click these arena-building steps in the right order:
Add 4 wall parts around the floor and anchor them
Delete the Baseplate and add the ArenaFloor part
Place 4 SpawnLocations in different corners
Add 6 pillars inside the walls for cover
๐Ÿง 
Knowledge Check
+15 XP
Why do we add 4 SpawnLocations in different corners of the arena?
ASo the arena floor looks more colourful
BSo players spawn in different places instead of all on top of each other
CSo the walls stay anchored in place
2
๐Ÿ“Š
Kill Leaderboard
Track kills and deaths for every player
Locked
๐ŸŽฏ
Goal for this step

Set up Kills and Deaths tracking on the leaderboard.

  • 1In ServerScriptService, add a Script named StatsSetup. Paste:
StatsSetup Script
game.Players.PlayerAdded:Connect(function(player) local stats = Instance.new("Folder") stats.Name = "leaderstats" stats.Parent = player local kills = Instance.new("IntValue") kills.Name = "Kills" kills.Value = 0 kills.Parent = stats local deaths = Instance.new("IntValue") deaths.Name = "Deaths" deaths.Value = 0 deaths.Parent = stats end)
โœ๏ธ
Fill in the Blanks
+15 XP
For stats to show on Roblox's leaderboard, the Folder must be named . We store the numbers using objects called Kills and Deaths.
๐Ÿง 
Knowledge Check
+15 XP
What exact name must the stats Folder have for Roblox to show it on the leaderboard?
APlayerStats
BScoreboard
Cleaderstats
3
๐Ÿ—ก๏ธ
Give Players a Sword
Equip every player with a sword when they spawn
Locked
๐ŸŽฏ
Goal for this step

Every player automatically receives a sword when they join the game.

Get the Classic Sword

  • 1In the Home tab, click Toolbox. Search for "Classic Sword". This is Roblox's built-in sword tool click it to insert it.
  • 2The sword appears in Workspace. Drag it into StarterPack in Explorer. Now every player spawns with it!
  • 3Press Play to test you should have a sword in your hotbar. Press 1 or click it to equip, then click to swing.
๐Ÿ’ก
The Classic Sword already has hit detection built in. When it hits another player it deals damage. Roblox handles this for you!
โšก
True or False?
+15 XP
Anything placed in StarterPack is given to every player when they spawn.
The Classic Sword already has hit detection and damage built in.
You have to write your own script to make the sword deal damage.
๐Ÿง 
Knowledge Check
+15 XP
Where should you drag the Classic Sword so every player spawns with it?
AStarterPack
BServerScriptService
CLighting
4
๐Ÿ’€
Track Kills & Deaths
Count kills and deaths automatically when players die
Locked
๐ŸŽฏ
Goal for this step

When a player dies, add 1 Death to them and 1 Kill to whoever killed them.

  • 1In ServerScriptService, add a new Script named KillTracker. Paste:
KillTracker Script
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) local humanoid = character:WaitForChild("Humanoid") humanoid.Died:Connect(function() -- Add a death player.leaderstats.Deaths.Value += 1 -- Find the killer via the sword tag local tag = humanoid:FindFirstChild("creator") if tag and tag.Value then local killer = tag.Value if killer ~= player then killer.leaderstats.Kills.Value += 1 end end end) end) end)
๐Ÿ“–
The Classic Sword automatically adds a creator tag to the Humanoid when it hits someone. Our script reads that tag to find who got the kill!
๐Ÿ”ฎ
Predict What Happens
+15 XP
Look at this line from the script:

if killer ~= player then killer.leaderstats.Kills.Value += 1

Why does the script check that the killer is NOT the same as the player who died?
ATo make the script run faster
BBecause Kills must always be a negative number
CSo players don't get a free kill for dying to lava or falling (killing themselves)
๐Ÿง 
Knowledge Check
+15 XP
How does the script find out who got the kill?
AIt asks the player to type their name
BIt reads the "creator" tag the sword adds to the Humanoid
CIt picks a random player from the server
5
โฑ๏ธ
Auto Respawn Timer
Show a countdown before players respawn after dying
Locked
๐ŸŽฏ
Goal for this step

Set a 5-second respawn time and show a countdown on screen.

Set respawn time

  • 1In Explorer, find Players (near the top). Click it and in Properties, set RespawnTime to 5. Players now wait 5 seconds before respawning.

Respawn countdown GUI

  • 2In StarterGui, add a ScreenGui named RespawnGui. Add a TextLabel named CountdownLabel. Size: {0.3, 0}, {0.1, 0}. Position: centre screen. Text: empty. Font: GothamBold. TextSize: 40. TextColor: red. BackgroundTransparency: 1.
  • 3Add a LocalScript inside RespawnGui:
LocalScript (inside RespawnGui)
local player = game.Players.LocalPlayer local label = script.Parent.CountdownLabel player.CharacterRemoving:Connect(function() for i = 5, 1, -1 do label.Text = "โ˜ ๏ธ Respawning in " .. i task.wait(1) end label.Text = "" end)
โœ๏ธ
Fill in the Blanks
+15 XP
We set the property of Players to 5 seconds. The countdown counts from 5 to 1 using a loop.
๐Ÿง 
Knowledge Check
+15 XP
In the loop for i = 5, 1, -1 do, what does the -1 do?
AIt counts down, subtracting 1 each time (5, 4, 3, 2, 1)
BIt makes the loop run -1 times
CIt deletes the label
6
๐Ÿ›’
Weapon Shop
Add a shop where players can pick up different weapons
Locked
๐ŸŽฏ
Goal for this step

Add a weapon rack area where players can walk in to grab a different sword.

Add more weapons from Toolbox

  • 1Open the Toolbox and search for another Roblox tool try "Linked Sword" or "Darkheart" (free Roblox tools).
  • 2Insert it. Move it to a corner of the arena. Place it on a pedestal (a flat glowing Part underneath it).
  • 3Build a small room/alcove for the weapon rack using a few wall parts. Add a sign saying "Weapon Shop" using a SurfaceGui TextLabel.
  • 4Players can simply walk into the weapon and pick it up Roblox Tools auto-equip when touched. No scripting needed!
  • 5Add a third weapon too give players variety. Try a Gravity Coil tool for movement or a "Bazooka".
๐Ÿ’ก
Make sure the tools are inside Workspace (not StarterPack) so they sit on the ground and can be picked up not auto-given!
โšก
True or False?
+15 XP
A Tool placed in Workspace sits on the ground and is picked up when a player touches it.
You need a script for players to pick up a weapon they walk into.
A SurfaceGui TextLabel can be used to make a "Weapon Shop" sign.
๐Ÿง 
Knowledge Check
+15 XP
Where must shop weapons go so players pick them up off the ground (not get them automatically)?
AStarterPack
BWorkspace
CReplicatedStorage
7
โค๏ธ
Health Bar GUI
Show a custom health bar at the bottom of the screen
Locked
๐ŸŽฏ
Goal for this step

Replace Roblox's default health bar with a custom red health bar.

  • 1In StarterGui, right-click โ†’ Insert Object โ†’ ScreenGui. Name it HealthBar. Set ResetOnSpawn to true.
  • 2Add a Frame (the background bar): Size {0.3, 0}, {0.03, 0}. Position {0.35, 0}, {0.92, 0}. BG Colour: dark red. UICorner 0.5.
  • 3Add another Frame inside the first (the fill bar). Same size. BG Colour: bright red. Name it Fill.
  • 4Add a TextLabel on top of the fill bar. Text: โค๏ธ 100. TextScaled true. BackgroundTransparency 1. TextColor white.
  • 5Add a LocalScript inside HealthBar:
LocalScript (inside HealthBar)
local player = game.Players.LocalPlayer local fill = script.Parent.Frame.Fill local label = fill.TextLabel local function update() local char = player.Character if not char then return end local hum = char:FindFirstChildWhichIsA("Humanoid") if not hum then return end local pct = hum.Health / hum.MaxHealth fill.Size = UDim2.new(pct, 0, 1, 0) label.Text = "โค๏ธ " .. math.floor(hum.Health) hum.HealthChanged:Connect(update) end player.CharacterAdded:Connect(function(char) char:WaitForChild("Humanoid") task.wait(0.1) update() end)
๐Ÿ”ฎ
Predict What Happens
+15 XP
The fill bar size is set with pct = hum.Health / hum.MaxHealth.

A player has 50 Health out of a MaxHealth of 100.

What size will the fill bar be?
AHalf full โ€” pct = 0.5, so the bar shows at 50% width
BCompletely full โ€” health bars are always 100%
CEmpty โ€” the bar disappears
๐Ÿง 
Knowledge Check
+15 XP
Which event lets the bar update the instant a player takes damage?
AHumanoid.Died
BPlayers.PlayerAdded
CHumanoid.HealthChanged
8
๐Ÿ†
Kill Announcement
Show a message when someone gets a kill
Locked
๐ŸŽฏ
Goal for this step

Broadcast a message to all players when a kill happens: "Player1 defeated Player2!"

  • 1In ReplicatedStorage, add a RemoteEvent. Name it KillAnnounce.
  • 2Update the KillTracker script after incrementing the kill, add:
Add to KillTracker (inside the kill if-block)
local event = game.ReplicatedStorage.KillAnnounce event:FireAllClients(killer.Name, player.Name)
  • 3In StarterGui, add a ScreenGui โ†’ TextLabel for announcements. Position it top-centre, large text, BackgroundTransparency 1.
  • 4Add a LocalScript inside the GUI:
LocalScript (kill announcement GUI)
local label = script.Parent.TextLabel game.ReplicatedStorage.KillAnnounce.OnClientEvent:Connect(function(killer, victim) label.Text = "โš”๏ธ " .. killer .. " defeated " .. victim .. "!" task.delay(3, function() label.Text = "" end) end)
โœ๏ธ
Fill in the Blanks
+15 XP
The server sends a message to everyone with , and each player's LocalScript listens for it using .
๐Ÿง 
Knowledge Check
+15 XP
What kind of object lets the server talk to every player's screen at once?
AAn IntValue
BA RemoteEvent
CA SpawnLocation
9
๐ŸŽจ
Decorate the Arena
Add torches, banners, traps and atmosphere
Locked
๐ŸŽฏ
Goal for this step

Make the arena look epic with fire, banners and environmental hazards.

๐Ÿ‘จโ€๐Ÿ‘ง
Parent note: Free build time let your child go creative here!
  • 1Add Fire effects: click a part โ†’ right-click in Explorer โ†’ Insert Object โ†’ Fire. Put fire in torches made from cylinder parts.
  • 2Add banners (tall thin parts, BrickColor bright red, with team emblems made from smaller parts attached).
  • 3Add a lava pit trap in the centre using the kill brick script from Episode 1.
  • 4Add a raised platform in the centre as a high ground advantage spot.
  • 5Use Lighting โ†’ Atmosphere (Insert Object โ†’ Atmosphere) to add dust and haze for a battle atmosphere.
โšก
True or False?
+15 XP
A Fire effect is added by inserting it as a child of a part in Explorer.
An Atmosphere object goes inside Lighting to add dust and haze.
A lava-pit trap needs no code โ€” it damages players all by itself.
๐Ÿง 
Knowledge Check
+15 XP
Which object do you add to Lighting to create a hazy, dusty battle atmosphere?
AA PointLight
BA SpawnLocation
CAn Atmosphere
10
โšก
Power-Up Pads
Add speed and health boost pads scattered around the arena
Locked
๐ŸŽฏ
Goal for this step

Add a speed boost pad and a heal pad for tactical gameplay.

  • 1Add a flat Part (size 4, 0.5, 4), BrickColor Cyan, Material Neon. Name it SpeedPad. Add a Script:
Script (SpeedPad)
local pad = script.Parent pad.Touched:Connect(function(hit) local char = hit.Parent local hum = char:FindFirstChildWhichIsA("Humanoid") if hum then hum.WalkSpeed = 30 task.delay(5, function() if hum then hum.WalkSpeed = 16 end end) end end)
  • 2Add a HealPad (BrickColor Bright green, Neon) with a Script that sets hum.Health = hum.MaxHealth when touched.
  • 3Add BillboardGui labels above each pad: "โšก Speed!" and "โค๏ธ Heal!".
๐Ÿ”ฎ
Predict What Happens
+15 XP
The SpeedPad sets WalkSpeed = 30, then uses task.delay(5, ...) to set it back to 16.

What does the player experience after touching the pad?
AThey walk fast forever
BThey walk fast for 5 seconds, then speed returns to normal (16)
CThey instantly stop moving
๐Ÿง 
Knowledge Check
+15 XP
Which event fires when a player steps on the pad part?
Apad.Touched
Bpad.PlayerAdded
Cpad.Clicked
11
๐Ÿ”Š
Battle Music
Add epic background music to the arena
Locked
๐ŸŽฏ
Goal for this step

Add looping background music that plays when the game starts.

  • 1In Workspace, right-click โ†’ Insert Object โ†’ Sound. Name it BattleMusic.
  • 2In Properties, set SoundId. Go to the Roblox Library (toolbox โ†’ Audio), search for "battle" or "epic" and find a free audio. Copy its ID (a number like rbxassetid://142376088).
  • 3Paste the SoundId. Set Looped to true. Set Volume to 0.5.
  • 4Add a Script in ServerScriptService named MusicPlayer:
MusicPlayer Script
workspace:WaitForChild("BattleMusic"):Play()
โœ๏ธ
Fill in the Blanks
+15 XP
Audio in Roblox is played from a object. To make it repeat forever, set its property to true.
๐Ÿง 
Knowledge Check
+15 XP
Which property tells a Sound which audio file to play?
AVolume
BLooped
CSoundId
12
๐ŸŒ
Test & Publish!
Invite friends and fight!
Locked
๐ŸŽฏ
Goal for this step

Final test using multiplayer test mode, then publish!

  • 1Go to Test tab โ†’ click the Players dropdown โ†’ set to 2 Players. This opens 2 windows so you can test multiplayer!
  • 2Fight yourself check kills and deaths track correctly. Check the kill announcement appears.
  • 3Test the speed pad, heal pad and weapon shop.
  • 4Press File โ†’ Publish to Roblox โ†’ Public. Share with friends and have a battle!
โš”๏ธ
Challenge your family to a sword fight in your arena first to 10 kills wins!
๐Ÿ”ข
Put It In Order
+15 XP
Click these in the correct order to test and publish your arena:
Test the speed pad, heal pad and weapon shop
Set the Players dropdown to 2 Players in the Test tab
File โ†’ Publish to Roblox โ†’ Public
Fight yourself and check kills and deaths track correctly
๐Ÿง 
Final Knowledge Check
+15 XP
How do you test your game with more than one player in Roblox Studio?
APublish first, then ask a friend to join online
BSet the Players dropdown to 2 Players in the Test tab
CYou can't โ€” Studio only ever tests one player
๐ŸŽ‰โš”๏ธ๐Ÿ†๐ŸŽŠ๐Ÿ’€
You Built a Battle Arena!

Epic a full multiplayer sword fight game with kill tracking, health bars, weapon shops, power-ups and music. Ready for something spooky?

๐Ÿ‘ป Episode 5: Horror Maze โ†’ โญ View My Progress & Certificates

This workshop was free and took many hours to build. If it helped you learn something new, consider supporting the project.

☕ Support on Ko-fi