The title says it all.
I've never been good with moving things with scripts, and I don't know how to grab a player's CFrame. Any help would be appreciated!
Basically what I want to do, is grab the LocalPlayer's CFrame after a certain function is ran, and then it teleports them to somewhere else and back after waiting a few seconds.
local player = game.Players.LocalPlayer function teleport(pos, t) local oldCFrame = player.Character:GetPrimaryPartCFrame() --Grabs prev. player CFrame player.Character:SetPrimaryPartCFrame(pos) --Teleports player to new CFrame wait(t) --Waits specified amount of time player.Character:SetPrimaryPartCFrame(oldCFrame) --Teleports player back to oldCFrame end teleport(CFrame.new(0, 100, 0), 1) --Example call that teleports player to 0, 100, 0 and back after 1 second