Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I update Text with Text and a Value? Error Shown.

How do I fix this error? I am trying to update a TextLabel with the predefined text 'Lvl' followed by their current Level. I am getting an error returning as:

19:23:27.968 - Players.Moxeh.PlayerGui.Store.MasterStore.RocketUpgradeFrame.SpeedLevel.Speed.U:5: ')' expected near ','

local stat = game.Players.LocalPlayer.PlayerStats:findFirstChild('SpeedLvl')
local cost = game.Players.LocalPlayer.PlayerGui.Store.MasterStore:findFirstChild('LevelCosts')
stat.Changed:connect(function (property)
	
	script.Parent.Text = ('Lvl', stat.Value)
end)

1 answer

✓ Accepted answer

We can use Concatenation which uses '..'

For example let's setup a variable and then print it with a string

local l = 10
print("Lvl: "..l.." is the level that I'm at")

1 comment

0

Had to modify it a little, but the Concatenation link solved my issue. Thank you!

This discussion is preserved as it was. New answers, comments, and votes are closed.