Írtam egy gyors fixet rá.
local upgomb = false
local downgomb = false
local leftgomb = false
local rightgomb = false
function playerPressedKey(button, press)
if (press) then
if button == \"arrow_l\" or button== \"a\" then
leftgomb = true
end
if button == \"arrow_r\" or button==\"d\" then
rightgomb = true
end
if button == \"arrow_u\" or button == \"w\" then
upgomb = true
end
if button == \"arrow_d\" or button==\"s\" then
downgomb = true
end
else
if button == \"arrow_l\"or button== \"a\" then
leftgomb = false
end
if button == \"arrow_r\" or button==\"d\" then
rightgomb = false
end
if button == \"arrow_u\" or button == \"w\" then
upgomb = false
end
if button == \"arrow_d\" or button==\"s\" then
downgomb = false
end
end
end
function processKeys()
if upgomb and downgomb then
setAnalogControlState(\"backwards\", 1)
elseif leftgomb and rightgomb then
setAnalogControlState(\"right\", 1)
elseif upgomb and leftgomb and rightgomb then
setAnalogControlState(\"right\", 1)
elseif downgomb and leftgomb and rightgomb then
setAnalogControlState(\"right\", 1)
else
if not downgomb then
setAnalogControlState(\"backwards\", 0)
end
if not rightgomb then
setAnalogControlState(\"right\", 0)
end
end
end
addEventHandler(\"onClientRender\", root, processKeys)
addEventHandler(\"onClientKey\", root, playerPressedKey)