Jump to content

Question

Posted

Hi, so I learn already how to make offset and read the memory if this is my player or my enemy.

 

So I wanna make a teleport script that teleport me to my enemy position.

So I can easily make a script that search a model ID, do a offset to find my player (1 results), edit x, y, z position easily.

 

Now I wanna make gg script that search a model ID, get my player model position (later use).

Then it will go to my enemy model and get the position, do the same thing to my other enemy.

 

Once it got all my enemy position, then it will create a button in gg.choice

 

Something like this

SCRIPT
Your player position is:
X: 32.5 Y: 50 Z: 20.5
----------------------------
Enemy 1 (Pos X: 75.32 Y: 50 Z: 32.5)
Enemy 2 (Pos X: 54.35 Y: 30 Z: 21.1)
Enemy 3 (Pos X: 71.49 Y: 50 Z: 67.7)

So ill click Enemy 2 since his position is almost near like mine.

 

Then GG Script will edit my player x y z, the same value like the enemy 2.

 

Then I successfully teleported myself to the enemy.

 

sry for my English.

10 answers to this question

Recommended Posts

  • 0
Posted

Hi @1x1, what games you're trying to hack? If it's an online multiplayer, there's a chance that the coordinate value is overrided by server.  Thus, you will be teleported back to your original position. X, Y, Z value is often in floats type or you can dump the game library if it's Unity based game (to make it more easier). I recommend to move this topic to Requests @Collen.

  • 0
Posted
14 minutes ago, MC189 said:

Hi @1x1, what games you're trying to hack? If it's an online multiplayer, there's a chance that the coordinate value is overrided by server.  Thus, you will be teleported back to your original position. X, Y, Z value is often in floats type or you can dump the game library if it's Unity based game (to make it more easier). I recommend to move this topic to Requests @Collen.

I would say a offline game.

 

what I mean is, I'm trying to create a gg script that make a gg.choice with all my enemy position.

 

I'll use Y velocity value to find all of them.

And it will show 7 results.

1 results — Me

6 Results — Enemy

 

I can do offset and to get x, y, z pos.

Pos are very near, same like jump, hitbox, velocity and size.

Also tell if that is a player or enemy.

 

So my script search for the y velocity -0.082

Do offset and get my player position, then create a button one by one of Enemy with position in gg.choice

 

I click the button of my enemy position then my position will be same as my enemy position.

 

sry my English, if you don't understand, u can tell me. I'll try to fix it.

  • 1
Posted
34 minutes ago, 1x1 said:

I would say a offline game.

 

what I mean is, I'm trying to create a gg script that make a gg.choice with all my enemy position.

 

I'll use Y velocity value to find all of them.

And it will show 7 results.

1 results — Me

6 Results — Enemy

 

I can do offset and to get x, y, z pos.

Pos are very near, same like jump, hitbox, velocity and size.

Also tell if that is a player or enemy.

 

So my script search for the y velocity -0.082

Do offset and get my player position, then create a button one by one of Enemy with position in gg.choice

 

I click the button of my enemy position then my position will be same as my enemy position.

 

sry my English, if you don't understand, u can tell me. I'll try to fix it.

Your able to differentiate between your player object and the one of the enemies?

  • 1
Posted (edited)
8 hours ago, 1x1 said:

So my script search for the y velocity -0.082

Do offset and get my player position, then create a button one by one of Enemy with position in gg.choice

I click the button of my enemy position then my position will be same as my enemy position.

sry my English, if you don't understand, u can tell me. I'll try to fix it.

Some example that i think can work but you have to adjust it here and there so it works for your game. Main thing to adjust is to separate your coords and that of enemy. I could not really test it so it can have some faults in syntax's or design.

gg.setRanges(gg.REGION_ANONYMOUS | gg.REGION_C_ALLOC | gg.REGION_OTHER)
gg.searchNumber('-0.082', gg.TYPE_FLOAT)
t = gg.getResults(7)

local check = {}
for i, v in ipairs(t) do
  check[i] = {address = v.address + 0x10, flags = gg.TYPE_DWORD}
end
check = gg.getValues(check)

local xCoordMe = {}
local yCoordMe = {}
local zCoordMe = {}
local xCoordEnemy = {}
local yCoordEnemy = {}
local zCoordEnemy = {}

for i, v in ipairs(check) do
  if v.value == 1 then -- the random value at the given offset to see if its enemy or you coordinates(1 result)
    xCoord_Me[#xCoord_Me + 1] = {address = v.address + 0x38, flags = gg.TYPE_FLOAT}
    yCoord_Me[#xCoord_Me + 1] = {address = v.address + 0x3C, flags = gg.TYPE_FLOAT}
    zCoord_Me[#xCoord_Me + 1] = {address = v.address + 0x40, flags = gg.TYPE_FLOAT}
  end
  
  if v.value == 2 then -- (6 results)
    xCoord_Enemy[#xCoord_Enemy + 1] = {address = v.address + 0x38, flags = gg.TYPE_FLOAT}
    yCoord_Enemy[#xCoord_Enemy + 1] = {address = v.address + 0x3C, flags = gg.TYPE_FLOAT}
    zCoord_Enemy[#xCoord_Enemy + 1] = {address = v.address + 0x40, flags = gg.TYPE_FLOAT}
  end
end

xCoordMe = gg.getValues(xCoordMe)
yCoordMe = gg.getValues(yCoordMe)
zCoordMe = gg.getValues(zCoordMe)
xCoordEnemy = gg.getValues(xCoordEnemy)
yCoordEnemy = gg.getValues(yCoordEnemy)
zCoordEnemy = gg.getValues(zCoordEnemy)

local final = {}
local getCoordsEnemy = {}
for i = 1, #xCoordEnemy do
  final[#final+1] = string.format("Your Player: x = %.15f, y= %.15f, z = %.15f", xCoordMe[i].value, yCoordMe[i].value, zCoordMe[i].value)
  final[#final+1] = string.format("Enemy Player: x = %.15f, y= %.15f, z = %.15f", xCoordEnemy[i].value, yCoordEnemy[i].value, zCoordEnemy[i].value)
  getCoordsEnemy[#getCoordsEnemy+1] = {[1] = xCoordEnemy[i].value, [2] = yCoordEnemy[i].value, [3] = zCoordEnemy[i].value} -- edited(wrong variable name)
end

menu = gg.choice(final)
if menu == nil then
  gg.toast("nothing selected")
else
  xCoordMe[1].value = getCoordsEnemy[menu][1]
  yCoordMe[1].value = getCoordsEnemy[menu][2]
  zCoordMe[1].value = getCoordsEnemy[menu][3]
  gg.setValues(xCoordMe)
  gg.setValues(yCoordMe)
  gg.setValues(zCoordMe)
end

Did some corrected in script.

Edited by nok1a
Did some correction in the script, variable was wrongly named
  • 0
Posted
On 6/4/2023 at 9:06 PM, nok1a said:

Some example that i think can work but you have to adjust it here and there so it works for your game. Main thing to adjust is to separate your coords and that of enemy. I could not really test it so it can have some faults in syntax's or design.

gg.setRanges(gg.REGION_ANONYMOUS | gg.REGION_C_ALLOC | gg.REGION_OTHER)
gg.searchNumber('-0.082', gg.TYPE_FLOAT)
t = gg.getResults(7)

local check = {}
for i, v in ipairs(t) do
  check[i] = {address = v.address + 0x10, flags = gg.TYPE_DWORD}
end
check = gg.getValues(check)

local xCoordMe = {}
local yCoordMe = {}
local zCoordMe = {}
local xCoordEnemy = {}
local yCoordEnemy = {}
local zCoordEnemy = {}

for i, v in ipairs(check) do
  if v.value == 1 then -- the random value at the given offset to see if its enemy or you coordinates(1 result)
    xCoord_Me[#xCoord_Me + 1] = {address = v.address + 0x38, flags = gg.TYPE_FLOAT}
    yCoord_Me[#xCoord_Me + 1] = {address = v.address + 0x3C, flags = gg.TYPE_FLOAT}
    zCoord_Me[#xCoord_Me + 1] = {address = v.address + 0x40, flags = gg.TYPE_FLOAT}
  end
  
  if v.value == 2 then -- (6 results)
    xCoord_Enemy[#xCoord_Enemy + 1] = {address = v.address + 0x38, flags = gg.TYPE_FLOAT}
    yCoord_Enemy[#xCoord_Enemy + 1] = {address = v.address + 0x3C, flags = gg.TYPE_FLOAT}
    zCoord_Enemy[#xCoord_Enemy + 1] = {address = v.address + 0x40, flags = gg.TYPE_FLOAT}
  end
end

xCoordMe = gg.getValues(xCoordMe)
yCoordMe = gg.getValues(yCoordMe)
zCoordMe = gg.getValues(zCoordMe)
xCoordEnemy = gg.getValues(xCoordEnemy)
yCoordEnemy = gg.getValues(yCoordEnemy)
zCoordEnemy = gg.getValues(zCoordEnemy)

local final = {}
local getCoordsEnemy = {}
for i = 1, #xCoordEnemy do
  final[#final+1] = string.format("Your Player: x = %.15f, y= %.15f, z = %.15f", xCoordMe[i].value, yCoordMe[i].value, zCoordMe[i].value)
  final[#final+1] = string.format("Enemy Player: x = %.15f, y= %.15f, z = %.15f", xCoordEnemy[i].value, yCoordEnemy[i].value, zCoordEnemy[i].value)
  getCoordsEnemy[#getCoordsEnemy+1] = {[1] = xCoordEnemy[i].value, [2] = yCoordEnemy[i].value, [3] = zCoordEnemy[i].value} -- edited(wrong variable name)
end

menu = gg.choice(final)
if menu == nil then
  gg.toast("nothing selected")
else
  xCoordMe[1].value = getCoordsEnemy[menu][1]
  yCoordMe[1].value = getCoordsEnemy[menu][2]
  zCoordMe[1].value = getCoordsEnemy[menu][3]
  gg.setValues(xCoordMe)
  gg.setValues(yCoordMe)
  gg.setValues(zCoordMe)
end

Did some corrected in script.

I may understand how the code work but it show an error.

 

Script ended:
Perhaps this script needs the latest version of GameGuardian. Try to update to the latest version.
Script error: luaj.LuaError: /storage/emulated/0/Download/Kizzy/player list to tp them.lua:26
`    xCoord_Enemy[#xCoord_Enemy + 1] = {address = v.address + 0x38, flags = gg.TYPE_FLOAT}`
attempt to get length of a nil value (global 'xCoord_Enemy')
level = 1, const = 34, proto = 0, upval = 1, vars = 19, code = 232
LEN v13 v13
 ; PC 79 CODE 06800355 OP 21 A 13 B 13 C 0 Bx 6656 sBx -124415
stack traceback:
	/storage/emulated/0/Download/Kizzy/player list to tp them.lua:26 in main chunk
	[Java]: in ?
	at luaj.LuaValue.checkmetatag(LuaValue.java:2835)
	at luaj.LuaValue.len(LuaValue.java:1989)
	at luaj.LuaClosure.execute(LuaClosure.java:451)
	at luaj.LuaClosure.call(LuaClosure.java:160)
	at android.ext.Script.runScript(Script.java:5703)
	at android.ext.Script$ScriptThread.run(Script.java:5441)

 

  • 0
Posted
17 hours ago, 1x1 said:

I may understand how the code work but it show an error.

 

Script ended:
Perhaps this script needs the latest version of GameGuardian. Try to update to the latest version.
Script error: luaj.LuaError: /storage/emulated/0/Download/Kizzy/player list to tp them.lua:26
`    xCoord_Enemy[#xCoord_Enemy + 1] = {address = v.address + 0x38, flags = gg.TYPE_FLOAT}`
attempt to get length of a nil value (global 'xCoord_Enemy')
level = 1, const = 34, proto = 0, upval = 1, vars = 19, code = 232
LEN v13 v13
 ; PC 79 CODE 06800355 OP 21 A 13 B 13 C 0 Bx 6656 sBx -124415
stack traceback:
	/storage/emulated/0/Download/Kizzy/player list to tp them.lua:26 in main chunk
	[Java]: in ?
	at luaj.LuaValue.checkmetatag(LuaValue.java:2835)
	at luaj.LuaValue.len(LuaValue.java:1989)
	at luaj.LuaClosure.execute(LuaClosure.java:451)
	at luaj.LuaClosure.call(LuaClosure.java:160)
	at android.ext.Script.runScript(Script.java:5703)
	at android.ext.Script$ScriptThread.run(Script.java:5441)

 

There is a type fault in variable naming. Remove the underscores in the variables of the for loop, xCoord_Me needs to be xCoordMe. Do that for all variables that are used for tables. So that they are the same name as the local variables 

local xCoordMe = {}
local yCoordMe = {}
local zCoordMe = {}
local xCoordEnemy = {}
local yCoordEnemy = {}
local zCoordEnemy = {}

 

  • 0
Posted
5 hours ago, nok1a said:

There is a type fault in variable naming. Remove the underscores in the variables of the for loop, xCoord_Me needs to be xCoordMe. Do that for all variables that are used for tables. So that they are the same name as the local variables 

local xCoordMe = {}
local yCoordMe = {}
local zCoordMe = {}
local xCoordEnemy = {}
local yCoordEnemy = {}
local zCoordEnemy = {}

 

now it show this

Script ended:
Perhaps this script needs the latest version of GameGuardian. Try to update to the latest version.
Script error: luaj.LuaError: /storage/emulated/0/Download/Kizzy/player list to tp them.lua:42
`  final[#final+1] = string.format("Your Player: x = %.15f, y= %.15f, z = %.15f", xCoordMe[i].value, yCoordMe[i].value, zCoor...`
attempt to index ? (a nil value) with key 'value' (field '?')
level = 1, const = 28, proto = 0, upval = 1, vars = 19, code = 220
GETTABLE v17 v17 "value"
 ; PC 147 CODE 08C28447 OP 7 A 17 B 17 C 266 Bx 8970 sBx -122101
stack traceback:
	/storage/emulated/0/Download/Kizzy/player list to tp them.lua:42 in main chunk
	[Java]: in ?
	at luaj.LuaValue.error(LuaValue.java:989)
	at luaj.LuaValue.indexerror(LuaValue.java:2864)
	at luaj.LuaValue.gettable(LuaValue.java:2767)
	at luaj.LuaValue.get(LuaValue.java:1094)
	at luaj.LuaClosure.execute(LuaClosure.java:358)
	at luaj.LuaClosure.call(LuaClosure.java:160)
	at android.ext.Script.runScript(Script.java:5703)
	at android.ext.Script$ScriptThread.run(Script.java:5441)

 

  • 0
Posted
8 minutes ago, 1x1 said:

now it show this

Script ended:
Perhaps this script needs the latest version of GameGuardian. Try to update to the latest version.
Script error: luaj.LuaError: /storage/emulated/0/Download/Kizzy/player list to tp them.lua:42
`  final[#final+1] = string.format("Your Player: x = %.15f, y= %.15f, z = %.15f", xCoordMe[i].value, yCoordMe[i].value, zCoor...`
attempt to index ? (a nil value) with key 'value' (field '?')
level = 1, const = 28, proto = 0, upval = 1, vars = 19, code = 220
GETTABLE v17 v17 "value"
 ; PC 147 CODE 08C28447 OP 7 A 17 B 17 C 266 Bx 8970 sBx -122101
stack traceback:
	/storage/emulated/0/Download/Kizzy/player list to tp them.lua:42 in main chunk
	[Java]: in ?
	at luaj.LuaValue.error(LuaValue.java:989)
	at luaj.LuaValue.indexerror(LuaValue.java:2864)
	at luaj.LuaValue.gettable(LuaValue.java:2767)
	at luaj.LuaValue.get(LuaValue.java:1094)
	at luaj.LuaClosure.execute(LuaClosure.java:358)
	at luaj.LuaClosure.call(LuaClosure.java:160)
	at android.ext.Script.runScript(Script.java:5703)
	at android.ext.Script$ScriptThread.run(Script.java:5441)

 

Seems to happen because one table is larger then the other. Change the [i] to [1] at the line you got the error.
xCoordMe[i].value, yCoordMe[i].value, zCoordMe[i].value

It's to be expected your filtering is accurate so that you only have 1 result for your characters coordinate.

  • 0
Posted
22 hours ago, nok1a said:

Seems to happen because one table is larger then the other. Change the [i] to [1] at the line you got the error.
xCoordMe[i].value, yCoordMe[i].value, zCoordMe[i].value

It's to be expected your filtering is accurate so that you only have 1 result for your characters coordinate.

It save my player model id, but an error came. 

Script ended:
Perhaps this script needs the latest version of GameGuardian. Try to update to the latest version.
Script error: luaj.LuaError: /storage/emulated/0/Download/Kizzy/player list to tp them.lua:42
`  final[#final+1] = string.format("Your Player: x = %.15f, y= %.15f, z = %.15f", xCoordMe[1].value, yCoordMe[1].value, zCoor...`
attempt to index ? (a nil value) with key 'value' (field '1')
level = 1, const = 28, proto = 0, upval = 1, vars = 19, code = 220
GETTABLE v17 v17 "value"
 ; PC 147 CODE 08C28447 OP 7 A 17 B 17 C 266 Bx 8970 sBx -122101
stack traceback:
	/storage/emulated/0/Download/Kizzy/player list to tp them.lua:42 in main chunk
	[Java]: in ?
	at luaj.LuaValue.error(LuaValue.java:989)
	at luaj.LuaValue.indexerror(LuaValue.java:2864)
	at luaj.LuaValue.gettable(LuaValue.java:2767)
	at luaj.LuaValue.get(LuaValue.java:1094)
	at luaj.LuaClosure.execute(LuaClosure.java:358)
	at luaj.LuaClosure.call(LuaClosure.java:160)
	at android.ext.Script.runScript(Script.java:5703)
	at android.ext.Script$ScriptThread.run(Script.java:5441)

 

  • 0
Posted
36 minutes ago, 1x1 said:

It save my player model id, but an error came. 

Script ended:
Perhaps this script needs the latest version of GameGuardian. Try to update to the latest version.
Script error: luaj.LuaError: /storage/emulated/0/Download/Kizzy/player list to tp them.lua:42
`  final[#final+1] = string.format("Your Player: x = %.15f, y= %.15f, z = %.15f", xCoordMe[1].value, yCoordMe[1].value, zCoor...`
attempt to index ? (a nil value) with key 'value' (field '1')
level = 1, const = 28, proto = 0, upval = 1, vars = 19, code = 220
GETTABLE v17 v17 "value"
 ; PC 147 CODE 08C28447 OP 7 A 17 B 17 C 266 Bx 8970 sBx -122101
stack traceback:
	/storage/emulated/0/Download/Kizzy/player list to tp them.lua:42 in main chunk
	[Java]: in ?
	at luaj.LuaValue.error(LuaValue.java:989)
	at luaj.LuaValue.indexerror(LuaValue.java:2864)
	at luaj.LuaValue.gettable(LuaValue.java:2767)
	at luaj.LuaValue.get(LuaValue.java:1094)
	at luaj.LuaClosure.execute(LuaClosure.java:358)
	at luaj.LuaClosure.call(LuaClosure.java:160)
	at android.ext.Script.runScript(Script.java:5703)
	at android.ext.Script$ScriptThread.run(Script.java:5441)

 

Do you mind giving me the game name? It's gone be hard fixing the script like this.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.