Help with adding prefix to value

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to add a prefix to a value
  2. What is the issue? Include screenshots / videos if possible!
    I can’t do it
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    Yes I have searched google and only got tutorials for admin commands
proof

an example of what i want to do
local foo = 100
local prefix = "something"
print(prefix AND foo)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

Assuming I understood your question:

print(prefix .. tostring(foo))

This should work, and if you wonder why I had to put “tostring” in there; roblox spits out an error if you try to combine a string (prefix) with anything else thats not a string (foo; integer). Essentially, tostring(foo) returns “100” as a string

1 Like

Actually, you can combine strings and numbers just fine:

Oh damn, really weird cause I keep getting errors when I try to do it.

It’s because the .. is not touching the number like: ..123 is. If you have them in variables, you will not need tostring() or the space.