Sim pois esta dentro de um loop, e qual necessidade de fazer um loop? e falta verificação se o jogador tem money, e se o jogador esta em um veículo or not, faça assim:
local arrumar1 = createMarker (2063.10, -1831.18, 13.54 -1, "cylinder", 1.5, 255, 255, 0, 170)
function Consertar (hitElement, matchingDimension)
if (getElementType (hitElement) ~= "player") then return end
if isElementWithinMarker (hitElement, arrumar1) then -- Se o jogador estiver no marker, então:
local theVehicle = getPedOccupiedVehicle (hitElement)
if (theVehicle) then -- Se o jogador estiver em um veículo, então:
if getPlayerMoney (hitElement) >= 3000 then -- Se o jogador estiver 3k ou +, então:
local preco = 3000
takePlayerMoney (hitElement, preco) -- Retira o valor da variável definida (preço = 3000)
fixVehicle (theVehicle) -- Repara o veículo do jogador.
outputChatBox ("Você consertou seu carro por $"..preco, hitElement, 0, 255, 0)
else -- Senão:
outputChatBox ("Erro! Você não tem dinheiro suficiente!", hitElement, 255, 30, 30)
end
else -- Senão:
outputChatBox ("Erro! Você não está em um veículo!", hitElement, 255, 30, 30)
end
end
end
addEventHandler ("onMarkerHit", arrumar1, Consertar)
OBS: Não testado.