So I wrote a line of code here
local stringvar = "Day"..NewData.Streak
All I want to know is if you can do this.
Thank you!
So I wrote a line of code here
local stringvar = "Day"..NewData.Streak
All I want to know is if you can do this.
Thank you!
yes, but are you sure NewData.Streak is a string?
Here is more code that should answer the question
local NewData = {}
NewData.Streak = 1
NewData.LastLogin = os.time()
if Premium.Value ~= true then
local Reward = StreakRewards[NewData.Streak]
local cash = game.ServerStorage.PlayerMoney:FindFirstChild(plr.Name)
cash.Value = cash.Value + Reward * Multiplier.Value
local stringvar = "Day"..NewData.Streak
NewData.Streak is a number… So should I do
local stringvar = "Day"..tostring(NewData.Streak)
Yes, You can do but I think you can simply do “Day”…NewData.Streak as I think you can index strings with numbers.