Im trying to make the player be teleported . Whilst being teleporting you will see a gui go from left to right . The gui is working but the tp isnt working ;/
script:
repeat
local player = game.Players.LocalPlayer
local TweenService = game:GetService("TweenService")
local frame = script.Parent
local function onTouch(part)
local humanoid = part.Parent:FindFirstChild('Humanoid')
if humanoid then
frame.Visible = true
wait(.4)
frame:TweenPosition(UDim2.new(-0.499, 0,0.499, 0))
wait()
player.Character.HumanoidRootPart.Cframe = CFrame.new(11, 1.5, 7)
wait(3)
frame.Visible = false
frame:TweenPosition(UDim2.new(1.55, 0,0.499, 0))
end
end
game.Workspace.Part.Touched:Connect(onTouch)
until wait(20)
