I have more of an idea of what to do but I'm still lost looks at this and please tell me where i've done something wrong.

script:

game.Players.PlayerAdded:connect(function(plr)
	local stat = Instance.new("Model")
	stat.Name = "leaderstats"
	stat.Parent = plr
	print(stat.Parent)
	
	local stat2 = Instance.new("NumberValue")
	stat2.Name = "Stage"
	stat2.Parent = stat
	print(stat2.Parent)
end)

for i,v in pairs(game.Workspace:GetChildren()) do
	if v.ClassName == "Part" then
		if v:FindFirstChild('Value') then
			print(v.Value.Value)
			game.Players.PlayerAdded:connect(function()
				v.Name = ("Spawn" .. v.Value.Value)
			end)
			v.Touched:connect(function(hit)
				if hit.Parent:FindFirstChild('Humanoid') then
					if hit.Parent.Humanoid.Health ~= 0 then
						if v.Value.Value == game.Players.LocalPlayer.leaderstats.Stage.Value+1 then
							game.Players.LocalPlayer.leaderstats.Stage.Value = v.Value.Value
						end
					end
				end
			end)
		end
	end
end

function moveCharacterToSpawn(chr, plr)
	plr.CharacterAdded:connect(function(chr)
		wait(0.2)
		for i,v in pairs(game.Workspace:GetChildren()) do
			if v.ClassName == "Part" then
				if v:FindFirstChild('Value') then
					if v.Value.Value == game.Players.LocalPlayer.leaderstats.Stage.Value then
						game.Players.LocalPlayer.Character:MoveTo(v.Position)
					end
				end
			end
		end
	end)
end

10 comments

0

So what exactly isn't working?

0

Nothing I just have no idea on how to make the player spawn at v if it is the one that contains the value equal to the leaderstat stage if you have any useful links from robloxx wiki or recomendation on how to do it pls help.

0

To give u a hint at hinting more towards me remember somewhere I made it so the name of v would change to Stage(the value)

0

Would you say that making a wait for character function that then involving what the other post uses?

0

Would u recomment making*

0

No need to make a separate function for it, but yes, you probably want to make sure the character exists first.

0

k thx

0

Just a friendly reminder, you do not need to make another comment if you've messed up on your first one. By clicking on the comment, it enables you to edit your own comment.

0

^thx