Will wait() affect all player in a CharacterAdded event since its a serverscript?

I know, I’m dumb. I just started scripting, Please don’t roast me

  1. What do you want to achieve? Keep it simple and clear!
    I want to know if wait() will cause a yield to all other players loading their tags since its a server script

  2. What is the issue? Include screenshots / videos if possible!
    Like I said above

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have tried looking for answers in devfourm

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
EXAMPLE:

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		if playerData:GetAsync(plr.UserId.."-points") > 0 then
			repeat wait() until plr.leaderstats.Points.Value > 0 -- the wait that I'm worried about
			
  		local data = plr.leaderstats.Points.Value
		if data > 0 and data < 10000 then
			local title = script.Level1:Clone()
			title.Parent = char.Head
			title.Adornee = char.Head
		end
		if data > 9999 and data < 100000 then
			local title = script.level2:Clone()
			title.Parent = char.Head
			title.Adornee = char.Head
			end
			if data > 99999 and data < 1000000 then
				local title = script.level3:Clone()
				title.Parent = char.Head
				title.Adornee = char.Head	
				end
		end
	end)
end)

Like all other events, PlayerAdded and CharacterAdded are placed on separate threads when fired. Placing a wait in the connected function will have no effect on the time in which another event is fired.

2 Likes