local Jogador = game.Players.LocalPlayer local Char = Jogador.Character local Humanoid = Char:WaitForChild("Humanoid") if true then print("Vida Carregada! HP Atual:") print(Humanoid.Health) end
I want to know how to print the phrase "Vida Carregada! HP Atual:" and the value of the Health in the side of the phrase at the output, so i can read both of them in the same line, how can I do it?
Thanks and sorry for my English, I dont speak it very well :)
How to print two things at the same time?
The print
function will output any number of arguments you pass. e.g.
print(1, 2, 3)
print("Vida Carregada! HP Atual:", Humanoid.Health)
(If this helped you please press accept answer)
The ..
operator is for concatenating strings.
print("hello, " .. "world")
The tostring()
function converts things that aren't strings (e.g., numbers like Humanoid.Health) to things that are
print(tostring(5))
Normally when you call print
it automatically calls tostring
on what you give it
If you want to print two things at once, you need to handle it yourself
print("Vida Carregada! HP Atual:" .. tostring(Humanoid.Health))
Don't use this use the other one, but it's still useful to know how tostring
and ..
work so I'm leaving it up.
..
has an implicit tostring
as well, apparently, effectively making this answer pointless.
..
doesn't have an implicit tostring
, it just apparently works with numbers.
If this answer doesn't go negative quick I'm just going to delete it for the sake of anybody who might stumble across it in the future and think it's anything but misinformation and LIES.