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:
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:
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
why billboard gui
, does it have something specific?
(i don’t know the differencebetween the guis lmao)
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)
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)
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
brickcolor for GUI???
this guy talking to you is clueless, heres how i did it:
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)
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
(edit) i’ll do a seperate topic for this to get more help
this is roblox devforum! no need to bully me!!!
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.
My bad
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.