перед функцией запили
local teamnum = 1
local teamplus = 1
local team = 0
И функцию запили так
function preRenderTeam(key, keyState)
//X,Y,Z = getCameraMatrix()
//start = getTickCount()
if (key == "a" or key == "arrow_l") then
if teamnum == 1 then
teamnum = 3
team = 2
elseif teamnum == 2 then
teamnum = teamnum - teamplus
team = 0
elseif teamnum == 3 then
teamnum = teamnum - teamplus
team = 1
end
elseif (key == "d" or key == "arrow_r") then
if teamnum == 1 then
teamnum = teamnum + teamplus
team = 1
elseif teamnum == 2 then
teamnum = teamnum + teamplus
team = 2
elseif teamnum == 3 then
teamnum = 1
team = 0
end
end
addEventHandler("onClientPreRender", getRootElement(), showTeam)
end
Вот так правильно должно работать.
В том, что я закомментировал не вижу смысла, по этому оставил, возможно оно тебе там надо будет в будущем, или ты чтото вырезал дабы не палить код.
А все, увидел смысл