10-21-2013, 07:39 AM
Btw, you're current way of executing TeleportToCursor will result in it being executed multiple times (one would need some real sick keypress/release to only trigger it once).
Best way to solve this is doing something like:
That way if it's false (not pressed) ==> teleports & sets it to true, then on next cycle (if still pressed) it's just again set to true but not actually teleporting. Then on release of the key it's actually released again in code too.
Best way to solve this is doing something like:
Code:
Teleport.KeyDown = false
function Teleport.Move3(event,tickcount)
if ( MeshManager:IsKeyPressed(160) ) then
if (not Teleport.KeyDown) then
GameHacks:TeleportToCursorPosition()
end
Teleport.KeyDown = true
else
Teleport.KeyDown = false
end
end
That way if it's false (not pressed) ==> teleports & sets it to true, then on next cycle (if still pressed) it's just again set to true but not actually teleporting. Then on release of the key it's actually released again in code too.
Frankly, my dear, I don't give a damn...