Uniblade

Gear · by Bubmeister

Brixborg's basic sword, for any game. It works like the classic linked sword: click to slash (10), two quick clicks to lunge (30), and the blade nicks anyone it brushes (5).

Use it in your games: in the studio, open View > Archive, go to the Gear shelf and pick "Uniblade".

To wear it, get it in the Shop: 50 Brixrods in the Shop

The script

-- Copyright (c) 2026 Brixborg Owners. All rights reserved. See LICENSE.txt.
-- THE UNIBLADE (by Bubmeister): Brixborg's basic sword, for any game. It works like the
-- classic linked sword. (A Script inside the tool.)
--
--   Click                slash: anyone the blade touches takes SLASH_DAMAGE
--   Two quick clicks     lunge: the blade swings from pointing up to
--                        pointing straight out in front for a moment, and
--                        anyone it touches takes LUNGE_DAMAGE
--   Just touching        IDLE_DAMAGE, until your first swing; after that a
--                        touch does a slash's damage (as the classic sword did)
--
-- The lunge doesn't lift or throw you: the skill is all in how you move.
-- Like the classic sword, the one who hit last gets the kill.

-- ===========================================================================
-- THE NUMBERS
-- ===========================================================================
local IDLE_DAMAGE = 5
local SLASH_DAMAGE = 10
local LUNGE_DAMAGE = 30
local LUNGE_CLICK = 0.2    -- a click this soon after the last one is a lunge (seconds)
local LUNGE_DELAY = 0.25   -- seconds before the blade comes out in a lunge...
local LUNGE_OUT = 0.75     -- ...and how long it stays out
local HIT_AGAIN = 0.1      -- (the same person can't be hit twice within this many seconds)
-- ===========================================================================

local tool = script.Parent
local handle = tool:WaitForChild("Handle")
local debris = game:GetService("Debris")
local players = game:GetService("Players")

-- How it is held: the blade pointing up (as it is made), or straight out.
-- Both keep the blade's flat to the side (rolled a quarter turn).
local GRIP_UP = tool.Grip
local GRIP_OUT = CFrame.new(GRIP_UP.p) * CFrame.Angles(0, 0, math.pi / 2)

local damage = IDLE_DAMAGE
local lastAttack = -10
local lastHit = {}        -- humanoid -> when the blade last hit them

local function sound(name, where, volume, pitch)
  local s = Instance.new("Sound", where)
  s.SoundId = "brixborg:" .. name
  s.Volume = volume or 0.5
  s.Pitch = pitch or 1
  s:Play()
  debris:AddItem(s, 1)
end

local function wielder()
  local character = tool.Parent
  if not character then return nil end
  return character, character:FindFirstChild("Humanoid"), players:GetPlayerFromCharacter(character)
end

local function tag(humanoid, player)
  local old = humanoid:FindFirstChild("creator")
  if old then old:Destroy() end
  local creator = Instance.new("ObjectValue")
  creator.Name = "creator"
  creator.Value = player
  creator.Parent = humanoid
  debris:AddItem(creator, 2)
end

-- The blade touched something: if it's someone else, they take the damage.
handle.Touched:connect(function(hit)
  local character, myHumanoid, player = wielder()
  if not myHumanoid or myHumanoid.Health <= 0 then return end
  local model = hit.Parent
  if model and model:IsA("Hat") then model = model.Parent end
  local victim = model and model:FindFirstChild("Humanoid")
  if not victim or model == character or victim.Health <= 0 then return end
  if time() - (lastHit[victim] or -10) < HIT_AGAIN then return end
  lastHit[victim] = time()
  tag(victim, player)
  victim:TakeDamage(damage)
  if damage > IDLE_DAMAGE then sound("slash", hit, 0.6) end
end)

local function slash()
  damage = SLASH_DAMAGE
  sound("swing", handle, 0.5)
  local swing = Instance.new("StringValue")
  swing.Name = "toolanim"
  swing.Value = "Slash"
  swing.Parent = tool
end

local function lunge()
  damage = LUNGE_DAMAGE
  sound("swing", handle, 0.8, 0.8)
  wait(LUNGE_DELAY)
  tool.Grip = GRIP_OUT
  wait(LUNGE_OUT)
  tool.Grip = GRIP_UP
  damage = SLASH_DAMAGE
end

tool.Equipped:connect(function()
  tool.Grip = GRIP_UP
  sound("swing", handle, 0.25, 1.3)   -- (drawing the sword)
end)

tool.Activated:connect(function()
  if not tool.Enabled then return end
  local _, humanoid = wielder()
  if not humanoid or humanoid.Health <= 0 then return end
  tool.Enabled = false
  local now = time()
  if now - lastAttack < LUNGE_CLICK then lunge() else slash() end
  lastAttack = now
  tool.Enabled = true
end)

More gear