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

How to print a variable followed by something?

Asked by
zomspi 541 Moderation Voter
5 years ago
Edited 5 years ago

I can i print a variable?

local Role = Knight

print("Your role is"Role)

Edit; nvm i fgured it out, you just add a ","

1 answer

Log in to vote
4
Answered by
karlo_tr10 1233 Moderation Voter
5 years ago
Edited 5 years ago

To merge arguments you should use ..:

print("Your role is "..Role)

Usage of a comma in your case will semi-work(It will print both but in reality, it's not merged). But If you want to apply it to TextLabel for example it wouldn't work.

local varibale1 = "hey"
local variable2 = "bye"

game.Workspace.Part.Name = varibale1,variable2 -- Will name it "hey"
game.Workspace.Part.Name = varibale1..variable2 -- Will name it "heybye"
Ad

Answer this question