it spams because u wrote here onClientRender
function thisistest(score)
addEventHandler("onClientRender", root, round5alltext)
end
addEvent("round5addtext", true)
addEventHandler("round5addtext", root, thisistest)
here u have very strange check (dim == 1) why ?:
function round5alltext()
local dim = getElementDimension(localPlayer)
for i, v in ipairs (getElementsByType("player")) do
if (dim == 1) then
dxDrawText("P1 RP: " .. PlayerTeam1CurrentRespawns, 118, 358, 291, 380, tocolor(255, 174, 0, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false)
dxDrawText("P2 RP: " .. PlayerTeam2CurrentRespawns, 767, 358, 940, 380, tocolor(255, 174, 0, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false)
end
end
end
and about error in debugger: what is this PlayerTeam1CurrentRespawns & PlayerTeam2CurrentRespawns in function round5alltext()? u trying concatenate nil value cuz they r undefined
solution: add after function createRound()..end this string
addEventHandler( "onClientResourceStart", resourceRoot,createRound)
after all, u can't concatenate integer values..wrap them via tostring() like as:
dxDrawText("P1 RP: " .. tostring(PlayerTeam1CurrentRespawns), 118, 358, 291, 380, tocolor(255, 174, 0, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false)