I’m running a gun shop GUI where the player clicks on the weapon and the detailed stats appear to the side. Problem is, I’m making 1 text label and trying to skip lines to include the stats quicker.
I have seen people using placeholders in strings to make it easier to write out but Ive never understood how it worked and the API on it is too complicated. Could anyone give me a quick example & explaining how I would make a string for a text label that will mention all the weapons stats and have a new line in between?
Here is the starting code I have:
function update(button)
local gunStats = weaponStatsFolder[button.Name]
gunText.Text = ("Pellet Damage: "..tostring(gunStats.Damage.Value))
end
script.Parent.Text = string.format([[
Pellet Damage: %d
Pellet Amount: %d
FireRate: %d
]], gunStats.Damage.Value, gunStats.Amount.Value, gunStats.Rate.Value) -- Insert the directories to the numerial values
-- You can use multi-line strings for better readability