Script show players on map

Im trying to show players on map with this client script and it works but starts heavy artifacts, help please.

Citizen.CreateThread(function()
while true do

local blip89 = AddBlipForEntity(GetPlayerPed(1)) 

SetBlipSprite(blip89, 1)

local blip45 = AddBlipForEntity(GetPlayerPed(2)) 

SetBlipSprite(blip45, 1)

local blip43 = AddBlipForEntity(GetPlayerPed(3)) 

SetBlipSprite(blip43, 1)

local blip65 = AddBlipForEntity(GetPlayerPed(4)) 

SetBlipSprite(blip65, 1)

local blip66 = AddBlipForEntity(GetPlayerPed(5)) 

SetBlipSprite(blip66, 1)

local blip90 = AddBlipForEntity(GetPlayerPed(6)) 

SetBlipSprite(blip90, 1)

local blip91 = AddBlipForEntity(GetPlayerPed(7)) 

SetBlipSprite(blip91, 1)

local blip111 = AddBlipForEntity(GetPlayerPed(8)) 

SetBlipSprite(blip111, 1)

local blip112 = AddBlipForEntity(GetPlayerPed(9)) 

SetBlipSprite(blip112, 1)

local blip113 = AddBlipForEntity(GetPlayerPed(10)) 

SetBlipSprite(blip113, 1)

local blip114 = AddBlipForEntity(GetPlayerPed(11)) 

SetBlipSprite(blip114, 1)

local blip115 = AddBlipForEntity(GetPlayerPed(12)) 

SetBlipSprite(blip115, 1)

local blip116 = AddBlipForEntity(GetPlayerPed(13)) 

SetBlipSprite(blip116, 1)

local blip117 = AddBlipForEntity(GetPlayerPed(14)) 

SetBlipSprite(blip117, 1)

local blip118 = AddBlipForEntity(GetPlayerPed(15)) 

SetBlipSprite(blip118, 1)

local blip119 = AddBlipForEntity(GetPlayerPed(16)) 

SetBlipSprite(blip119, 1)

local blip120 = AddBlipForEntity(GetPlayerPed(17)) 

SetBlipSprite(blip120, 1)

local blip121 = AddBlipForEntity(GetPlayerPed(18)) 

SetBlipSprite(blip121, 1)

local blip122 = AddBlipForEntity(GetPlayerPed(19)) 

SetBlipSprite(blip122, 1)

local blip123 = AddBlipForEntity(GetPlayerPed(20)) 

SetBlipSprite(blip123, 1)

local blip124 = AddBlipForEntity(GetPlayerPed(21)) 

SetBlipSprite(blip124, 1)

local blip125 = AddBlipForEntity(GetPlayerPed(22)) 

SetBlipSprite(blip125, 1)

local blip126 = AddBlipForEntity(GetPlayerPed(23)) 

SetBlipSprite(blip126, 1)

local blip127 = AddBlipForEntity(GetPlayerPed(24)) 

SetBlipSprite(blip127, 1)

local blip128 = AddBlipForEntity(GetPlayerPed(25)) 

SetBlipSprite(blip128, 1)

local blip129 = AddBlipForEntity(GetPlayerPed(26)) 

SetBlipSprite(blip129, 1)

local blip130 = AddBlipForEntity(GetPlayerPed(27)) 

SetBlipSprite(blip130, 1)

local blip131 = AddBlipForEntity(GetPlayerPed(28)) 

SetBlipSprite(blip131, 1)

local blip132 = AddBlipForEntity(GetPlayerPed(29)) 

SetBlipSprite(blip132, 1)

local blip133 = AddBlipForEntity(GetPlayerPed(30)) 

SetBlipSprite(blip133, 1)

local blip134 = AddBlipForEntity(GetPlayerPed(31)) 

SetBlipSprite(blip134, 1)

local blip135 = AddBlipForEntity(GetPlayerPed(32)) 

SetBlipSprite(blip135, 1)

Citizen.Wait(1)

end
end)

@Satur You only ahve to add blips once. Otherwise you keep adding them. What this does is basicly every tick add a new blip for every player which causes thousands of blips to be created.

@kanersps Thanks a lot, how I put it, like: SetBlipSprite(blip89,blip45,blip43,blip65,blip66 1) or otherwise, sorry but im learning

@Satur What he means is remove the “while true do” loop. With that loop, it will add the blip every single frame/tick. Once a blip is added, it will remain unless removed. With the way it is setup now, it repeatedly adds blips on top of each other.

@Briglair Ok thanks i understand now

@Briglair What can i use? without while true do, its not working, thanks

@Satur There should be a function for when the player joins. I forget the exact name of it. I’m not home right now to be able to check either. When a player joins, have the server create the blip on the ID associated with that player.

@Briglair Thanks maybe its OnPlayerSpawn as kanersps told me in other thread

@Satur

Why do you do blip89 then blip45 then blip43. Why don’t you just use blip1, blip2, blip3? Does it not work like this?