Hello, I am making a racing game. I made checkpoints and everything works! The only problem is.. I want to make a place system. I tried many things, I heard of zomebody's Progression module, but its too hard for me to understand. Let me explain In mario kart, if you are infront of everybody while racing, you would be 1st place However, if you was behind everybody, the complete opposite. I tried to do some research, but most of them was just like super hard I really mean this hard. It may be easy for you but not really for me. Here is some code on the checkpoints.

--[[
Its really just messy the way studio put it.
But this is just the script that detects everything and makes the player win if they did 1 lap.
--]]
function checkpoint1hit(hit) 
	if hit ~= nil and hit.Parent:FindFirstChild("Humanoid") and hit.Parent ~= nil then
		if not script.Parent.Checkpoint1:FindFirstChild(hit.Parent.Name) then
			print("Player hit it!")
			local thing = Instance.new("StringValue")
			thing.Name = hit.Parent.Name
			thing.Parent = script.Parent.Checkpoint1
		end
	end
	if script.Parent.Checkpoint7:FindFirstChild(hit.Parent.Name) then
		print("A WINNER")
		game.Workspace.Winner.Value = hit.Parent.Name
		game.ReplicatedStorage.Win:Fire()
	end
end

function checkpoint2hit(hit)
	if hit ~= nil and hit.Parent:FindFirstChild("Humanoid") and hit.Parent ~= nil then
		if not script.Parent.Checkpoint2:FindFirstChild(hit.Parent.Name) then
			print("Player hit 2!")
			local thing = Instance.new("StringValue")
			thing.Name = hit.Parent.Name
			thing.Parent = script.Parent.Checkpoint2
		end
	end
end
function checkpoint3hit(hit)
	if hit ~= nil and hit.Parent:FindFirstChild("Humanoid") and hit.Parent ~= nil then
		if not script.Parent.Checkpoint3:FindFirstChild(hit.Parent.Name) then
			print("Player hit 3!")
			local thing = Instance.new("StringValue")
			thing.Name = hit.Parent.Name
			thing.Parent = script.Parent.Checkpoint3
		end
	end
end
function checkpoint4hit(hit)
	if hit ~= nil and hit.Parent:FindFirstChild("Humanoid") and hit.Parent ~= nil then
		if not script.Parent.Checkpoint4:FindFirstChild(hit.Parent.Name) then
			print("Player hit 4!")
			local thing = Instance.new("StringValue")
			thing.Name = hit.Parent.Name
			thing.Parent = script.Parent.Checkpoint4
		end
	end
end
function checkpoint5hit(hit)
	if hit ~= nil and hit.Parent:FindFirstChild("Humanoid") and hit.Parent ~= nil then
		if not script.Parent.Checkpoint5:FindFirstChild(hit.Parent.Name) then
			print("Player hit 5!")
			local thing = Instance.new("StringValue")
			thing.Name = hit.Parent.Name
			thing.Parent = script.Parent.Checkpoint5
		end
	end
end
function checkpoint6hit(hit)
	if hit ~= nil and hit.Parent:FindFirstChild("Humanoid") and hit.Parent ~= nil then
		if not script.Parent.Checkpoint6:FindFirstChild(hit.Parent.Name) then
			print("Player hit 6!")
			local thing = Instance.new("StringValue")
			thing.Name = hit.Parent.Name
			thing.Parent = script.Parent.Checkpoint6
		end
	end
end
function checkpoint7hit(hit)
	if hit ~= nil and hit.Parent:FindFirstChild("Humanoid") and hit.Parent ~= nil then
		if not script.Parent.Checkpoint7:FindFirstChild(hit.Parent.Name) then
			print("Player hit 7!")
			local thing = Instance.new("StringValue")
			thing.Name = hit.Parent.Name
			thing.Parent = script.Parent.Checkpoint7
		end
	end
end
script.Parent.Checkpoint1.Touched:Connect(checkpoint1hit)
script.Parent.Checkpoint2.Touched:Connect(checkpoint2hit)
script.Parent.Checkpoint3.Touched:Connect(checkpoint3hit)
script.Parent.Checkpoint4.Touched:Connect(checkpoint4hit)
script.Parent.Checkpoint5.Touched:Connect(checkpoint5hit)
script.Parent.Checkpoint6.Touched:Connect(checkpoint6hit)
script.Parent.Checkpoint7.Touched:Connect(checkpoint7hit)

I attempted to make a place system with attributes and stuff, but that was a fail so I scrapped it all up, I don't think I can retrieve the code again. Any help is appreciated!

3 comments

0

Im trying to understand the module more, i think im getting some progress, if i manage to make it work, i will make this solved and then put a solution for others who has my problem.

0

I can imagine a method for races along straight lines: From an invisible block on the finish line, find the magnitude of the distances between this block and each player's vehicle. Order this distance in descending, the first element of this table is first place. No idea how to order dictionaries however.

0

Thanks for feedback.