So basically i was just messing around w types and i have come to this error, I have no clue why this happens since it works fine when i just remove the obj part of the type
--!strict
local ts = game:GetService("TweenService")
local module = {}
type tweenargs = {
obj: Instance,
time: number,
easingstyle: Enum.EasingStyle?,
goal: {[any]: any}
}
function module.Tween(args: tweenargs)
if typeof(args) ~= "table" then
warn("tween requires a table vro")
return
end
local tf = TweenInfo.new(args.time, args.easingstyle)
local tween = ts:Create(args.obj, tf, args.goal)
return tween
end
local inst = Instance.new("Part", workspace)
local args = {
obj = inst,
time = 25,
easingstyle = Enum.EasingStyle.Linear,
goal = {5}
}
module.Tween(args)
return module
(I’m just testing that’s why I’m calling it in the same module)
It errors when i call the function and gives me that error
I’m just completely lost on what the problem is. Any help appreciated