hey! I am making a game when you need to teleport after you touch a button. However when I touch it, it teleports me, and when I try to move, it just teleports me back to the position about 2 more times.
script:
local tweenService = game:GetService("TweenService")
local elavator = script.Parent
local tweenInfo = TweenInfo.new(3,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0.1)
local properties = {Position = Vector3.new(-57.5, 13.3, 17.5)}
local tween = tweenService:Create(elavator,tweenInfo,properties)
local db = false
script.Parent.Touched:Connect(function(hit)
if not db then
db = false
wait(5)
tween:Play()
wait(5)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid ~= nil then
humanoid.Parent.HumanoidRootPart.CFrame = CFrame.new(workspace["teleport1"].Position)
wait(100)
local db = true
end
end
end)