View previous topic :: View next topic |
Author |
Message |
Timm3D How do I cheat?
Reputation: 0
Joined: 11 Jun 2019 Posts: 6
|
Posted: Mon May 10, 2021 6:18 am Post subject: Advanced player teleportation. |
|
|
Hello together,
maybe the title isn't the best explanation, but I will try to explain you guys my plan so that maybe one will understand what the hell I'm trying to do:
So I've got all player coords (X, Z, Y) and all camera coords. I want to create a hack which teleports the player exactly 2 in game meters forward wherever I'm currently looking at. So for example if the player stands before a locked door and I press my teleport hotkey, It should teleport him through the door, and he will stand behind it.
I uploaded two very high quality gimp pics to show you my thinking. The first picture represents the explanation before.
So maybe much of you want to tell me that I simply have to add/sub the x or z coords by +2 or -2 to do this, but this method has a big problem: When the door or the point I'm looking at isn't at a horizontal or vertical position, then it will teleport me somewhere else because for this I have to change X and Z to do so. (Look at picture 2).
So how I'm going to do this? Do I need the cam rotation or something? If someone knows how to do this, I would be very happy if you could tell me.
Thanks in advance!
Description: |
|
Filesize: |
425.88 KB |
Viewed: |
6846 Time(s) |

|
Description: |
|
Filesize: |
450.75 KB |
Viewed: |
6846 Time(s) |

|
|
|
Back to top |
|
 |
TheyCallMeTim13 Wiki Contributor
Reputation: 51
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Mon May 10, 2021 6:43 am Post subject: |
|
|
You'd have to do a bit of math with the viewport and vectors of the player. Your best bet for understanding how to do this would be to look into how aimbots are made. And you'd likely have to figure out where the map floor is so you don't fall through the map every time you use it.
Another option is to use the last shot coordinates, basically use where a bullet last hit. Or a teleport to waypoint hack.
_________________
|
|
Back to top |
|
 |
Gear2ndGandalf Cheater
Reputation: 0
Joined: 22 Jan 2018 Posts: 36 Location: USA
|
Posted: Sun Jan 12, 2025 9:48 pm Post subject: |
|
|
ANSWER in form of LUA.
I had ChatGPT's help but was able to make a LUA teleport script that does just as you're asking. This was done using cheat engine on Kingdom Hearts Re: Chain of Memories (STEAM).
For Yaw (player facing direction) you need to know if you're using radians (-3.14 to 3.14) or degrees (0 to 1). This is important because it will determine if you use ex: math.cos(yaw) or math.cos(math.rad(yaw)). The latter converts radians to degrees if I'm not mistaken.
Also it's possible to get X and Y pointers backwards. Look out for that too.
Code: | {$lua}
if syntaxcheck then return end
[ENABLE]
getLuaEngine().cbShowOnPrint.Checked=false -- "stop LUA errors from appearing"
getLuaEngine().hide() -- "stop LUA errors from appearing"
X_address = "[[KINGDOM HEARTS Re_Chain of Memories.exe+0087B380]+F0]+38" -- "X Coordinates Pointer"
Y_address = "[[KINGDOM HEARTS Re_Chain of Memories.exe+0087B380]+F0]+30" -- "Y Coordinates Pointer"
Yaw_address = "[[KINGDOM HEARTS Re_Chain of Memories.exe+0087B380]+F0]+54" -- "Player Facing Pointer"
distance = 5.0
delay = 750 -- "Not typically needed. I use it to match the dodge roll animation time before being able to use hotkey again"
local teleport = createTimer() -- "Create a timer"
destroyTimer = false -- "Do not destroy"
teleport.Enabled = true --
teleport.Interval = 1 -- "Check every millisecond for function"
teleport.OnTimer = function(dodge) -- "Function named dodge on timer start"
if destroyTimer then dodge.destroy() end -- Only when script is disabled
local currentX = readFloat(X_address) -- "Read player X"
local currentY = readFloat(Y_address) -- "Read player Y"
local yaw = readFloat(Yaw_address) -- "Read player Yaw"
local newX = currentX + distance * math.cos(yaw) -- "USE math.cos(math.rad(yaw)) for degrees"
local newY = currentY + distance * math.sin(yaw) -- "USE math.sin(math.rad(yaw)) for degrees"
if isKeyPressed(0x5802) or isKeyPressed(VK_SHIFT) then -- "ex. 0x5802 is X/Square button"
writeFloat(X_address, newX) -- "Teleport Player X Coordinates"
writeFloat(Y_address, newY) -- "Teleport Player Y Coordinates"
sleep(delay) -- "Wait 750 milliseconds after hotkey input"
end
end
[DISABLE]
destroyTimer = true -- "Disable hotkey detection by destroying timer" |
|
|
Back to top |
|
 |
|