Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How should I smoothly "glide" move model trought Part? I really don't have any idea rn!

Asked by 5 years ago

So, I tried moving smoothly moving model through Part and it doesn't work, here's the script. So IDK another way to move the model.

local Portal = game:GetService("Workspace"):WaitForChild("RealmTP")
Pos2 = CFrame.new(458.969, 19.581, 946.224) -- Position of the Portal in air
Pos1 = CFrame.new(458.969, 16.571, 946.224) -- Portal Ground position


local TweenService = game:GetService("TweenService")
local TweenAGoal = {}
TweenAGoal.Position = Pos2
local TweenATime = TweenInfo.new(2.5) -- Time to be doned

local TweenBGoal = {}
TweenAGoal.Position = Pos1
local TweenBTime = TweenInfo.new(0.7) -- Time to be doned

local TweenA = TweenService:Create(Portal, TweenATime, TweenAGoal)
local TweenB = TweenService:Create(Portal, TweenBTime, TweenBGoal)
for i,Player in pairs (game:GetService("Players")) do
    local Database = Player:WaitForChild("Database") -- Waits for Database inside Player
    Database:WaitForChild("Value_Inv"):WaitForChild("CompletedZombie").Changed:Connect(function()
        if Database:WaitForChild("Value_Inv"):WaitForChild("CompletedZombie").Value == true then

            TweenA:Play()
                wait(2.5)
            TweenB:Play()

            end
    end)
end

Answer this question