Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you make someone spawn at a different location without teams?

So I am making an obby and I made stages and the stages work but when I get to the stage 2 spawn, I sometimes spawn back at stage 1. How do you make it so when you get to stage 2 and so on that you spawn there?

2 answers

✓ Accepted answer

Ok, so make a part to step on to make your spawn there on stepped. Use this script in your spawn part. Also, just put ONE spawn location at start. Hope you enjoy!

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

Important: JUST put ONE spawn location AT your desired first stage. And insert this script into a PART.

function oa(object) local player = game.Players:playerFromCharacter(object) if player ~= nil then local ls = player.leaderstats local sl = game.Workspace:FindFirstChild(ls.Stage.Value) object.Torso.CFrame = object.Torso.CFrame + Vector3.new(0,3,0) wait() object.Torso.CFrame = sl.CFrame + Vector3.new(0,3,0) end end

function oe(object) if object.className == "Player" then local ack = Instance.new("IntValue") ack.Name = "leaderstats" local ack2 = Instance.new("IntValue") ack2.Name = "Stage" ack2.Value = 1 ack2.Parent = ack ack.Parent = object end end

game.Players.ChildAdded:connect(oe) game.Workspace.ChildAdded:connect(oa)

(Try this.)

6 comments

0

That makes no sense, I need a full explanation.

0

In this, functions are over viewing changing the Stage.Value, and where the CFrame of the "Humanoid", or character, spawns.

0

This site hates code without explanation.

0

I have seen that,

1

Ikr, this does not makes sense. Lol

0

Try fiddling around with some properties on the spawn.

This discussion is preserved as it was. New answers, comments, and votes are closed.