Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to write player positional data? #42

Open
raimanya opened this issue Oct 6, 2020 · 5 comments
Open

How to write player positional data? #42

raimanya opened this issue Oct 6, 2020 · 5 comments

Comments

@raimanya
Copy link

raimanya commented Oct 6, 2020

Can someone provide me with the code to change the players position? I've tried rewriting the WriteMemory_IsImposter() multiple times now to make it change the player position, but with no success. Please someone send me a a WriteMemory_Position() method because this is driving me insane lmao

@randomcmd
Copy link

I was thinking the same thing!

@shlifedev
Copy link
Owner

shlifedev commented Oct 7, 2020

    public void WriteMemory_PositionX(float value)
        {
           
                int _offset_vec2_position = 80;
                var netTransform = ((int)Instance.NetTransform + _offset_vec2_position);
                var targetPointer = netTransform + 4;  
                Cheese.mem.WriteMemory(targetPointer.GetAddress(), "float", value.ToString());
         
        }



    public void WriteMemory_PositionY(float value)
        {
           
                int _offset_vec2_position = 80;
                var netTransform = ((int)Instance.NetTransform + _offset_vec2_position);
                var targetPointer = netTransform + 8;  
                Cheese.mem.WriteMemory(targetPointer.GetAddress(), "float", value.ToString());
         
        }

But you can't change real player position. it's network received value.
So, this example code work, but no effect.

@vladimirdabic
Copy link

But are you able to edit the local player's position? I'm guessing the client (you) is sending your position so changing it shouldn't be a problem.

@rushiiMachine
Copy link

Yes you can, but if the server has checks for player positions, teleporting will not work.
But if not, the player position will not change server-side until you send a position update packet.

@pythonmcpi
Copy link

Note that the server side anticheat now bans you for hacking if you teleport across the map and kill (at least in my case, although I was using a different mod which may be using a different method)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants