local TweenService = game:GetService("TweenService")
local Part = script.Parent
local Touched = false
local tweenInfo = TweenInfo.new(1.5, Enum.EasingStyle.Sine)
local destination = {
Position = Vector3.new(-217.13, 3.888, -144.923)
}
local defaultPosition = {
Position = Vector3.new(-252.13, 3.888, -144.923)
}
local tweenToDestination = TweenService:Create(Part, tweenInfo, destination)
local tweenToDefault = TweenService:Create(Part, tweenInfo, defaultPosition)
Part.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid and not Touched then
Touched = true
Part.BrickColor = BrickColor.new("Lime green")
task.wait(1)
tweenToDestination:Play()
tweenToDestination.Completed:Wait()
task.wait(1)
tweenToDefault:Play()
tweenToDefault.Completed:Wait()
Part.BrickColor = BrickColor.new("Really red")
Touched = false
end
end)
How can I make the player not fall into the void and keep standing on the part?