RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"Make a checkpoint spawner"
-- server script (ServerScriptService) local checkpointTemplate = game.ServerStorage.CheckpointTemplate function spawnCheckpoint(position) local newCheckpoint = checkpointTemplate:Clone() newCheckpoint.Position = position newCheckpoint.Parent = game.Workspace end local spawnPositions = { Vector3.new(0, 0, 100), Vector3.new(100, 0, 100), Vector3.new(200, 0, 100), } for _, position in ipairs(spawnPositions) do spawnCheckpoint(position) end -- script for checkpoint local part = script.Parent local debounce = true local function onTouched(otherPart) local player = game.Players:FindFirstChild(otherPart.Parent.Name) if player and debounce then debounce = false player.RespawnLocation = part wait(1) debounce = true end end part.Touched:Connect(onTouched)