How would i make this tween script move the player with the model?

This is the script:

wait(10)

local model = script.Parent
local TS = game:GetService(“TweenService”)

local targetPosition = Vector3.new(-5.93, 18.668, -273.441)

for _, part in ipairs(model:GetDescendants()) do
if part:IsA(“BasePart”) then
local goal = { Position = part.Position + (targetPosition - model:GetModelCFrame().Position) }
TS:Create(part, TweenInfo.new(10, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), goal):Play()
end
end

use:

local player = game:GetService("Players").LocalPlayer
local character = player.Character
local humanoid = character:FindFirstChildOfClass("Humanoid")
 humanoid:MoveTo(targetPosition)

ohhh with the model, my bad
try

wait(10)

local model = script.Parent
local player= game:GetService("Players").LocalPlayer
local character = player.Character
local TS = game:GetService(“TweenService”)

local targetPosition = Vector3.new(-5.93, 18.668, -273.441)

for _, part in ipairs(model:GetDescendants()) do
if part:IsA(“BasePart”) then
local goal = { Position = part.Position + (targetPosition - model:GetModelCFrame().Position) }
TS:Create(part, TweenInfo.new(10, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), goal):Play()
end
for _, part in ipairs(character:GetDescendants()) do
if part:IsA(“BasePart”) then
local goal = { Position = part.Position + (targetPosition - model:GetModelCFrame().Position) }
TS:Create(part, TweenInfo.new(10, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), goal):Play()
end

it isnt really a local script, its a server script, i’ll still try and make it work

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