Tycoon Issue, Players past 2 aren't assigned a tycoon

Right now I’ve just setup a really simple script which honestly I didn’t think I’d have a problem with.

There’s a value in each tycoon called “Owner” when a player joins the script scans through the tycoons and finds an owner value that is empty and assigns it to the player. I ran this on a test server with 2 players, the second player wasn’t given a tycoon. Any ideas why?

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
	
	-- Find Unowned Tycoon
	
	local Tycoons = game.Workspace:FindFirstChild("Tycoons")
	
	for i, Tycoon in ipairs(Tycoons:GetChildren()) do
		
		if Tycoon:FindFirstChild("Owner").Value == "" then
			
			Tycoon:FindFirstChild("Owner").Value = player.Name
			Tycoon:FindFirstChild("Door").Arch.Display.plrName.Text = player.Name.."'s Tycoon"
			print(player.Name.." now owns "..Tycoon.Name)
			
			
		end
		
	end
	
end)

you never break out of the loop after assigning one tycoon, you are assigning all tycoons to the first person that joins

1 Like

I’m not entirely sure how I’d do that?

just put break after your print