I want to write 2 intValue and a String beetwen in a labelText.
textStats = script.Parent
local harvest = game.Players.LocalPlayer.folder.Harvest
local bag = game.Players.LocalPlayer.folder.Bag
while true do
wait(0.1)
harvestString = tostring(harvest.Value)
bagString = tostring(bag.Value)
textStats.Text = harvestString, " / ", bagString ( Line underline in orange )
print(harvestString, " / ", bagString)
end
In my textLabel only harvestString is write but in the output thanks to the print, it write correctly
.. needs to be used to separate actual strings (can not be a number, bool or data value. Use tostring(value) if you want to add a bool, number or data value to a string) when assigning strings to e.g. TextLabel.Text
, can be used to separate strings, bools, numbers and whatnot when using print() (separates and adds one space inbetween e.g. print("cow","milk") would print > cow milk )
Simply enter the text you’d like to display, with %s in place of your variables. You then specify the variables - in order - as the parameters.
This essentially allows you to create template strings. If you care about micro-optimisations, I believe string.format is also quicker than concatenation.