Universal Script 📌
390 Views
256 Executions

Damage indicator

Universal Script 📌
Zale
ZalePublished 5
8 months ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

View Raw
-- Settings
local DAMAGE_COLOR = Color3.fromRGB(255, 75, 75)
local DEATH_COLOR = Color3.fromRGB(255, 0, 0)
local HEAVY_HIT_THRESHOLD = 50
local DISPLAY_TIME = 1.3
local BASE_SHAKE = 0.12
local BASE_SIZE = 2.2 

local function formatDamage(amount)
    local absAmount = math.abs(amount)
    -- If the number is round (e.g. 20.0), show as "20"
    -- If it has a decimal (e.g. 20.1), show as "20.1"
    if absAmount % 1 == 0 then
        return tostring(math.floor(absAmount))
    else
        return string.format("%.1f", absAmount)
    end
end

local function createIndicator(targetPart, amount, isDeath)
    local billboard = Instance.new("BillboardGui")
    billboard.Size = UDim2.new(BASE_SIZE, 0, BASE_SIZE, 0)
    billboard.Adornee = targetPart
    billboard.AlwaysOnTop = true
    billboard.ExtentsOffset = Vector3.new(0, 3, 0)
    
    local label = Instance.new("TextLabel")
    label.Size = UDim2.new(1, 0, 1, 0)
    label.BackgroundTransparency = 1
    label.TextScaled = true
    label.Font = Enum.Font.Cartoon
    label.TextStrokeColor3 = Color3.fromRGB(0, 0, 0)
    label.TextStrokeTransparency = 0
    label.Rotation = math.random(-15, 15)
    
    local isHeavy = math.abs(amount) >= HEAVY_HIT_THRESHOLD
    
    if isDeath then
        label.Text = "DEATH"
        label.TextColor3 = DEATH_COLOR


Comments

0
Log in to join the conversation. Login
No comments yet. Be the first!

More universal scripts

See all
Universal Script 📌
28.3k
663.4k
Bumped 34 minutes ago
Script hub
13.5k
2.7k
Bumped 3 hours ago
Key System
Paid
Script hub
263.1k
88.1k
Bumped 4 hours ago
Key System
Universal Script 📌
2.4k
9.4k
Bumped 4 hours ago
Universal Script 📌
220
29
Approved 4 hours ago
Universal Script 📌
246
26
Approved 4 hours ago
Universal Script 📌
269
9
Approved 4 hours ago