Hey,
I’m trying to teleport the player whenever it dies to the last checkpoint.
Howhere, the following line of the script doesn’t work:
Player.Character:MoveTo(Check.CFrame.Position)
Here’s a part of the script to give an idea:
--Service
local Players = game:GetService("Players")
local DSS = game:GetService("DataStoreService")
local CDS = DSS:GetDataStore("ChartDataStore")
--On player joins
function New(Player)
local function Character(Char)
--MovePlayer
local Folder = game.Workspace.Data:WaitForChild(Player.Name)
local Check = game.Workspace.Checkpoints:WaitForChild(Folder.Value)
print(Check)
Player.Character:MoveTo(Check.CFrame.Position)
end
Player.CharacterAdded:Connect(Character)
end
--On player Left
function Left(Player)
--Stuff
end
--Starter
Players.PlayerAdded:Connect(New)
Players.PlayerRemoving:Connect(Left)
--Service
local Players = game:GetService("Players")
local DSS = game:GetService("DataStoreService")
local CDS = DSS:GetDataStore("ChartDataStore")
--On player joins
function New(Player)
local function Character(Char)
--MovePlayer
task.wait()
local Folder = game.Workspace.Data:WaitForChild(Player.Name)
local Check = game.Workspace.Checkpoints:WaitForChild(Folder.Value)
print(Check)
Player.Character:MoveTo(Check.CFrame.Position)
end
Player.CharacterAdded:Connect(Character)
end
--On player Left
function Left(Player)
--Stuff
end
--Starter
Players.PlayerAdded:Connect(New)
Players.PlayerRemoving:Connect(Left)