Table values shown as nil, when numbers are clearly not 0

Hey there!

I’m working on improving my code, however i got myself stuck.

I am trying to make some variables (numbers) to strings so I can access them in a loop. However, when I try to play the game, it shows the values to be ‘nil’

    local subs = (player["stats"].Subs.Value + 250) * player.stats.Multiplier.Value * player.stats.SubsMultiplier.Value
	local videoViews = math.round((math.random(10,30)/10) * subs)
	local videoLikes = math.round((math.random(2,7)/10) * videoViews)
	local videoSubs =  math.round((math.random(5, 15)/100) * videoViews)
	remotes.PostVideo:FireServer(videoViews, videoLikes, videoSubs)
	
	local dataTable = {
		'vidViews' == videoViews,
		'vidLikes' == videoLikes,
		'vidSubs' == videoSubs
	}
	
	for i, stat in pairs({'Views','Likes','Subs'}) do
		local popup = replicatedStorage[stat..'Popup']:Clone()
		popup.Parent = popupFrame
		
		coroutine.wrap(function()
			popup.Parent = popupFrame popup.Position = UDim2.new((math.random(0,100)/100),0,(math.random(0,100)/100), 0)
			task.wait(4)
			popup:Destroy()
		end)()
		
		local tweenVal = Instance.new("NumberValue")
		print(dataTable[videoViews])
		local tween1 = tweenService:Create(tweenVal, numberTweenInfo, {Value = dataTable["vid"..stat]})
		print(tweenVal.Value)

Here is what i’m trying to show.
robloxapp-20240929-0841291.wmv (622.2 KB)

How can i fix this??

nvm i am sorry to tell you all but i am a stupid dookie

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.