I am using Roblox's Default Checkpoints for my game, they do not seem to work when cloned out of replicated storage. Here is an example

Checkpoints A and B are both in replicatedStorage

Moves Checkpoint A to workspace and steps on it and resets Character.

Checkpoint A works

Checkpoint A is removed from workspace and Checkpoint B is put in workspace

Dies on checkpoint B

Spawns At default spawn point.

I need help with this please. For anyone wondering, here is the script.

local spawn = script.Parent
spawn.Touched:connect(function(hit)
	if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
		local player = game.Players:GetPlayerFromCharacter(hit.Parent)
		local checkpointData = game.ServerStorage:FindFirstChild("CheckpointData")
		if not checkpointData then
			checkpointData = Instance.new("Model", game.ServerStorage)
			checkpointData.Name = "CheckpointData"
		end
		
		local checkpoint = checkpointData:FindFirstChild(tostring(player.userId))
		if not checkpoint then
			checkpoint = Instance.new("ObjectValue", checkpointData)
			checkpoint.Name = tostring(player.userId)
			
			player.CharacterAdded:connect(function(character)
				wait()
				character:WaitForChild("Torso").CFrame = game.ServerStorage.CheckpointData[tostring(player.userId)].Value.CFrame + Vector3.new(0, 4, 0)
			end)
		end
		
		checkpoint.Value = spawn
	end
end)

1 comment

0

Bump..? It's been a day and ive tried all I can.