'5' is not a valid member of TweenInfo

im trying to do a tween on all clients (because its smoother than doing it on the server)

im getting the error ‘5’ is not a valid member TweenInfo (i attached an image below)
the TweenInfo im referencing is a table that has all the properties of the real TweenInfo so i can fire it through a remote event

ive looked on youtube and an the dev forum but i cant find anyone that has gotton this error

module.Tween = function(instance, tweenInfo, properties)
	if threads[instance] ~= nil then task.cancel(threads[instance]) threads[instance] = nil end
	event:FireAllClients(instance, tweenInfo, properties)
	if tweenInfo[5] == true then return end
	local repeatCount = tweenInfo[4] or 0
	if repeatCount < 0 then return end
	local delayTime = tweenInfo[6] or 0
	local tweenTime = tweenInfo[1] or 1
	threads[instance] = task.delay((delayTime * tweenTime) * (repeatCount + 1), TweenEnded, instance, properties)
end

image

1 Like
module.Tween = function(instance, tweenInfo, properties)
	if threads[instance] ~= nil then task.cancel(threads[instance]) threads[instance] = nil end
	event:FireAllClients(instance, tweenInfo, properties)
	if tweenInfo.Reverses == true then return end
	local repeatCount = tweenInfo.RepeatCount or 0
	if repeatCount < 0 then return end
	local delayTime = tweenInfo.DelayTime or 0
	local tweenTime = tweenInfo.Time or 1
	threads[instance] = task.delay((delayTime * tweenTime) * (repeatCount + 1), TweenEnded, instance, properties)
end
1 Like

i read somewhere that putting the [number] was the same as putting “.Reverses” or any of those, did that change?

because i have a function that makes it work how i put (or at least i thought it did)

local threads = {}

local function TweenEnded(instance, properties)
	threads[instance] = nil
	for index, property in properties do instance[index] = property end
end

properties is probably a dictionary.