local platform = script.Parent
local startPos = platform.Position
local endPos = startPos + Vector3.new(0, 0, 10) -- куда движется
while true do
platform.Position = endPos
wait(2)
platform.Position = startPos
wait(2)
endlocal TweenService = game:GetService("TweenService")
local platform = script.Parent
local startPos = platform.Position
local endPos = startPos + Vector3.new(0, 0, 15)
local tweenInfo = TweenInfo.new(3, Enum.EasingStyle.Linear)
while true do
local tween1 = TweenService:Create(platform, tweenInfo, {Position = endPos})
tween1:Play()
tween1.Completed:Wait()
local tween2 = TweenService:Create(platform, tweenInfo, {Position = startPos})
tween2:Play()
tween2.Completed:Wait()
endplatform.Touched:Connect(function(hit)
local character = hit.Parent
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
character.PrimaryPart.Anchored = true
end
end)
platform.TouchEnded:Connect(function(hit)
local character = hit.Parent
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
character.PrimaryPart.Anchored = false
end
end)local endPos = startPos + Vector3.new(0, 20, 0)local points = {
Vector3.new(0, 5, 0),
Vector3.new(10, 5, 0),
Vector3.new(10, 5, 10)
}
for i = 1, #points do
platform.Position = points[i]
wait(2)
end