What's the method of accomplishing these cool damage numbers?

so, most games have a damage indicator that shows how much damage your attack did

but how do you actually make something like that?

(not asking for an entire script, i just need the method)

if someone doesn’t get it:

1 Like

I don’t know if this is the most efficient method, but when you successfully hit a character (from a server script) you could fire a remote event with the hit part and the damage amount, then in a local script, create a billboard gui instance with text that shows the damage, play some tween animations and destroy it later

2 Likes

why billboard gui, does it have something specific?

(i don’t know the differencebetween the guis lmao)

1 Like

ScreenGui’s are the gui objects on the screen, a SurfaceGui is basically like a screen on a part (like a gui just placed onto a part) and a BillboardGui is like a mix, where the gui is in the world and you can like actually see it (like for example if you’ve ever seen a proximity prompt in a game, thats a billboard gui)

2 Likes

I think you could do something like this

example:)

--This is a basic hit script (on the server)
local plr = script.Parent.Parent --I don't know if to get the player is script.Parent or script.Parent.Parent
local damageAmount = 10
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid:TakeDamage(damageAmount)
game.ReplicatedStorage.DamageShowcase:FireClient(plr, damageAmount, hit) -- Passes the damage and stuff
end
end)

And in a local script,

game.ReplicatedStorage.DamageShowcase.OnClientEvent:Connect(function(damage, hitPart)
local billboardgui = Instance.new("BillboardGui")
billboardgui.Parent = hitPart
local text = Instance.new("Textlabel")
text.Parent = billboardgui
text.BackgroundTransparency = 1
text.TextColor3 = Color3.fromRGB(255, 255, 255)
text.Text = damage
--No fancy animation to make it disappear but you could easily make a fade out or somethimg
task.wait(5)
billboardgui:Destroy()
end)
1 Like

how do i change the position of a BillboardGUI?

i’m checking the properties and it doesn’t seem to have anything position-related besides AbsolutePosition, which is locked

image
image

brickcolor for GUI???

this guy talking to you is clueless, heres how i did it:

  • remote event connects damage done on client to the server
  • get a textlabel and design it with the preferred font and color
  • clone it to the player’s ui each time you wanna display damage with the number gathered from the remote event

unless you want a specific way of displaying damage physically, like in the clip, youd use a billboard gui to a part instead of the player’s ui

isn’t that exactly what @IndeedMythical did??

i mean, i’m left with this as of rn:

HeavyEvent.OnServerEvent:Connect(function(player, dagger, part, keyframe)
	local enemy = part.Parent:FindFirstChild("Humanoid")
	local SFX = Instance.new("Sound")
	local damage = 33
	
	SFX.Parent = enemy
	SFX.SoundId = "rbxassetid://16815968728"
	
	enemy:TakeDamage(damage)
	
	DamageGUIEvent:FireClient(player, damage, enemy)
	SFX:Play()
	
	SFX.Ended:Wait()
	SFX:Destroy()
	
end)
DamageGUIEvent.OnClientEvent:Connect(function(damage, enemy)
	local Billboard = Instance.new("BillboardGui")
	Billboard.Parent = enemy
	
	local Text = Instance.new("TextLabel")
	Text.Parent = Billboard
	Text.BackgroundTransparency = 1
	Text.TextColor = BrickColor.new(255, 255, 255)
	Text.Text = damage
	
	local enemyCFrame = enemy.Parent:FindFirstChild("HumanoidRootPart").CFrame
	
	local fadeOut = TS:Create(Text, TweenInfo.new(3, Enum.EasingStyle.Circular, Enum.EasingDirection.Out), {TextTransparency = 1})
	local rise = TS:Create(Billboard, TweenInfo.new(3, Enum.EasingStyle.Circular, Enum.EasingDirection.Out), {StudsOffsetWorldSpace = Vector3.new(enemyCFrame, enemyCFrame, enemyCFrame)})
	
	fadeOut:Play()
	rise:Play()
	
	fadeOut.Completed:Wait()
	rise.Completed:Wait()
	
	fadeOut:Destroy()
	rise:Destroy()
	Billboard:Destroy()
	Text:Destroy()
end)

the text doesn’t seem to be visible, although the gui and textlabel gets created

how exactly does the clip showcase physically?

in decaying winter, from my understanding, the damage is displayed in the workspace (locally)

what i described is just like a hit indicator from say, dummies vs noobs, where it displays the damage on the players screen rather than workspace

so what you’re saying is:

(via client)

  • add a part
  • parent it to the hit target
  • add billboardgui(?) to it
  • add textlabel
  • do the text
  • tween the part instead

if youre trying to mimic decaying winter then yes

you also dont need to use any remotes at all if you dont want to

just use a script to check if the humanoid’s health changes, then display that change if its less than the health before the change

i believe theres some undertale damage indicator in the toolbox that performs this you could take reference from

what exactly would the difference be between mimicing DW and using a simple billboard gui

do you have any comparison?

billboard gui is what dw seems to use, since its aligned to a physical space in the workspace

the billboard gui basically lets you put ui elements on to it

if you used a simple billboard gui youd still need to figure out a way to put it in workspace

maybe it can be aligned to the head of the enemy being damaged, but then it would move as the enemy moves

you could also just clone small parts, cframe it to the enemy, then tween the position of the billboard gui

1 Like

(edit) i’ll do a seperate topic for this to get more help :point_right: :point_left:

this is roblox devforum! no need to bully me!!! :sob::sob::sob::sob:

In fact, I do know what I’m doing! Here is a video of a result I made trying to replicate the damage indicator in <20 minutes, with a fancy red color when you hit the head

The only thing I didn’t account for in my post was the gui scaling, and AlwaysOnTop.

1 Like

My bad

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.