So basically i have a error with my Tweening Module and a collection service script, it just shows the error
TweenService:Create no property named ‘Position’ for object ‘DoorLeft’
and im not sure what causes it. Any help is good!!!
Module Script:
local Module = {}
local TweenService = game:GetService("TweenService")
function Module.TweenModel(instance, tweenInfo, goal)
return TweenService:Create(instance, tweenInfo, { Position = Vector3.new(goal) }):Play()
end
return Module
CollectionService Script:
local global = require(game.ServerScriptService.Server.Scripts.Global)
local collection = game:GetService("CollectionService")
local Door = collection:GetTagged("DBR")
for _,door in pairs(Door) do
local model = door
local goal1 = door:WaitForChild("DoorLeft").ToGoPos.CFrame
local goal2 = door:WaitForChild("DoorRight").ToGoPos.CFrame
local sounds = door:WaitForChild("Frame")
local dl = door.DoorLeft:WaitForChild("MainGlass").CFrame
local dr = door.DoorRight:WaitForChild("MainGlass").CFrame
local DLL = door.Frame:WaitForChild("Attachment").ProximityPrompt
local busy = false
local open = false
local dllwait = 3
local tweendll = TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut)
DLL.Triggered:Connect(function()
if open == false and busy == true then
end
if open == true and busy == true then
end
if open == false and busy == false then
open = true
busy = true
task.wait()
global.TweenModel(door.DoorLeft, tweendll, goal1)
global.TweenModel(door.DoorRight, tweendll, goal2)
task.wait(dllwait)
global.TweenModel(door.DoorLeft.MainGlass, tweendll, dl)
global.TweenModel(door.DoorRight.MainGlass, tweendll, dr)
task.wait(0.3)
busy = false
open = false
end
end)
end