I want to make the player teleport to a specific point when he/she interacts with a gui. The code is below, only one line i am having problem with, the rest are fine and works as intended.
local TweenService = game:GetService("TweenService")
local function TweenFromPlace(C1,C2)
workspace.Camera.CFrame = C1.CFrame
local TweenProps = {CFrame = C2.CFrame}
local TI = TweenInfo.new(7.5, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 1, false, 0)
TweenPlay = TweenService:Create(workspace.Camera, TI, TweenProps)
TweenPlay:Play()
end
script.Parent.MouseButton1Down:Connect(function()
script.Parent.Parent.Visible = false
script.Parent.Parent.Parent.This.Visible = false
workspace.Camera.CFrame = workspace.Cam1.CFrame
workspace.Camera.CameraType = Enum.CameraType.Scriptable
workspace.Camera.CFrame = workspace.Cam1.CFrame
-- this is where i am having problems, the line below
game.Workspace.AriyanHacker29.HumanoidRootPart.Position = workspace.Part.Position
TweenFromPlace(workspace.Cam1, workspace.Cam2)
wait(7.5)
TweenFromPlace(workspace.Cam2, workspace.Cam3)
wait(7.5)
TweenPlay:Cancel()
workspace.Camera.CameraType = Enum.CameraType.Custom
script.Parent.Parent.Visible = true
script.Parent.Parent.Parent.This.Visible = false
wait (18)
print("DONE")
end)
