Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can i put the number of two int values togheter using a script?

Asked by 2 years ago
Edited 2 years ago
local race = Player:WaitForChild("Values").Race.Value
    local variation = Player:WaitForChild("Values").Variation.Value
    print(race..variation)

so basically i want the number the race value and the number of the variation value to be together in a text box so like if race's value is 3 and variation value is 1 i want it to print "31"

1 answer

Log in to vote
2
Answered by 2 years ago
Edited 2 years ago

You have two numbers right now, convert them to a string then concatenate (join them) as shown below:

local race = Player:WaitForChild("Values").Race.Value
local variation = Player:WaitForChild("Values").Variation.Value

print(tostring(race)..tostring(variation))

Even so, this is unnecessary because you could just do what you did lmao... Look here:

sh link to lua interpreter

So this entire time you did it right.

Although if you want to add them simple do race+variation

0
yeah your right, i realised this wasnt my issue, it was that i was running it too soon for the values to actually load so i just put a wait(5) and it worked soreno2468 31 — 2y
Ad

Answer this question