I was wondering in other programming languages like python you have f strings where you could add a variable in the middle of the printing how do you do this in roblox tho?
Example in a local script
local button = script.Parent local player = game.Players.LocalPlayer local text = "Hello, Playersnamehere welcome to the game" -- here you have where the player's name is which is referring to the local player. button.Text = text -- changes the buttons text to the text above
I forgot what it is called but you use .. (2 periods) for example
local Name = "BOB" print("Welcome to the game" .. Name)
Yes, concatenation would accomplish what you need, although there is another method. You can format strings.
An example of this would be:
local Player = game.Players.LocalPlayer local text = ("Hello, %s welcome to the game"):format(Player.Name)
or
local Player = game.Players.LocalPlayer local text = string.format("Hello, %s welcome to the game", Player.Name)