abhijeet1001 Advanced Cheater Reputation: 0
Joined: 10 Apr 2013 Posts: 87
|
Posted: Wed Jan 22, 2014 10:39 pm Post subject: Flying Script help |
|
|
Hello all i was working on a game its PC game small single player shooting game ( 42 Mb) "assualt cube "
i been trying to make a FLY hack by using (y axis coords) like when i click jump it increases my y axis value and when i leave the space bar it comes back to original ( to make it feel like flying ) now problem is its not working like i want to when i press spacebar it directly bumbs me at +200 on y axis and when i leave space bar i dont even come down , i know i didnt scripted it right but thats y i am asking here because i was unable to make it perfect
here is what i made
Code: | jump = 1
function checkKeys(timer)
if (isKeyPressed(VK_SPACE)) then
if jump ~= 10 then
LuaCall(AobswapC("8B 4E 3C 89 56 08 89 4E 0C D8 46 0C D9 5E 0C 48 33 FF 85 C0 7E 1D 8B 15 DC BE 4F 00 52","8B 8E C8 00 00 00 89 4E 0C D8 46 0C D9 5E 0C 48 33 FF 85 C0 7E 1D 8B 15 DC BE 4F 00 52"))
jump=10
end
else
if jump ~= 1 then
LuaCall(AobswapC("8B 8E C8 00 00 00 89 4E 0C D8 46 0C D9 5E 0C 48 33 FF 85 C0 7E 1D 8B 15 DC BE 4F 00 52","8B 4E 3C 89 56 08 89 4E 0C D8 46 0C D9 5E 0C 48 33 FF 85 C0 7E 1D 8B 15 DC BE 4F 00 52"))
jump=1
end
end
end
t=createTimer(nil)
timer_setInterval(t, 100)
timer_onTimer(t, checkKeys)
timer_setEnabled(t, true)
|
Regards
EDIT : got a tip from a friend Daspammer " i wasnt assigning the onkey functions so i did Code: |
jump = 1
function checkKeys(timer)
if (isKeyPressed(VK_SPACE)) then
if jump ~= 10 then
onkeyDown(VK_SPACE,LuaCall(AobswapC("8B 4E 3C 89 56 08 89 4E 0C D8 46 0C D9 5E 0C 48 33 FF 85 C0 7E 1D 8B 15 DC BE 4F 00 52","8B 8E C8 00 00 00 89 4E 0C D8 46 0C D9 5E 0C 48 33 FF 85 C0 7E 1D 8B 15 DC BE 4F 00 52")))
jump=10
end
else
if jump ~= 1 then
onkeyUp(VK_SPACE,LuaCall(AobswapC("8B 8E C8 00 00 00 89 4E 0C D8 46 0C D9 5E 0C 48 33 FF 85 C0 7E 1D 8B 15 DC BE 4F 00 52","8B 4E 3C 89 56 08 89 4E 0C D8 46 0C D9 5E 0C 48 33 FF 85 C0 7E 1D 8B 15 DC BE 4F 00 52")))
jump=1
end
end
end
t=createTimer(nil)
timer_setInterval(t, 100)
timer_onTimer(t, checkKeys)
timer_setEnabled(t, true)
function DEC_HEX(IN)
local B,K,OUT,I,D=16,"0123456789ABCDEF","",0
if IN<1 then
OUT=0
return OUT
end
while IN>0 do
I=I+1
IN,D=math.floor(IN/B),math.mod(IN,B)+1
OUT=string.sub(K,D,D)..OUT
end
return OUT
end
function Aobswap(search, change)
aobs = AOBScan(search)
if(aobs ~= nil) then
j = stringlist_getCount(aobs)
for i = 1, j do
address=stringlist_getString(aobs,i-1)
for i = 1, string.len(change), 3 do
z = string.sub(change, i, i+2)
x, y = string.find(z, "%?+")
if (x == nil) then
script=[[
]]..address.."+"..(DEC_HEX((i-1)/3))..[[:
db ]]..z..[[
]]
autoAssemble(script)
end
end
end
object_destroy(aobs);
aobs=nil
end
end
function AobswapC(search, change)
aobs = AOBScan(search)
if(aobs == nil) then AobSwapCheck=false else
j = stringlist_getCount(aobs)
for i = 1, j do
address=stringlist_getString(aobs,i-1)
for i = 1, string.len(change), 3 do
z = string.sub(change, i, i+2)
x, y = string.find(z, "%?+")
if (x == nil) then
script=[[
]]..address.."+"..(DEC_HEX((i-1)/3))..[[:
db ]]..z..[[
]]
autoAssemble(script)
end
end
end
object_destroy(aobs);
aobs=nil
AobSwapCheck=true
end
end
|
now even after doing that when i press SpaceBar in game i get his error
"[code]Error:[string "..."]:7: attempt to call global 'OnKeyDown' (a nil value)"
PS : i think aobscan is making it slow any other way to make the checking faster too ?
EDIT
i found out how to do that i use CE and set hotkeys to incease the y axis with 10 when space bar is pressed so if i keep ressing i keep getting upp upp works llike i want but any idea how to put this stuff in a script so i can make a trainer or something
|
|