Attempt to concatenate string with boolean

  1. What do you want to achieve?
    I want to mix string and boolean
    Need this (EXAMPLE):
print("Hello world: " true)

--Output:
Hello world: true
  1. What is the issue?
    Its not working for some reason.

  2. What solutions have you tried so far?
    I tried tostring searched on devhub devforum and rodevs.

1 Like

Comma:

print("Hello world: ", true)

--Output:
Hello world: true
2 Likes

It prints out

Hello world:

Edit: nvm it works with printing

Sorry try this:

print("Hello World", string.format(true))

Wait sorry i typed wrong example, I need.

local Text = "Hello world: "..tostring(true)

--Output:
Hellow world: true

Ideally you can do this:

boolVal = true
print(string.format("Hello world %s", boolVal and "true" or "false"))

Pretty sure it works @robustvesel3

1 Like

How can I configure to this?,
I dont really understand it.

local Text = "Ignited: "..string.format(BOOL)

Edit: Nevermind got it, thanks for your time.

Sorry for replying to an answered post but couldn’t you just do this to achieve what you want?

print("Hello World:"..tostring(true))

Oh yeah I got that, I had the script done wrong in my script after all