Advertisement
Undecised

Infinite Jump

Jun 16th, 2020
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Game.command("infjump", (caller, args) => {
  2.     const player = getPlayer(args)
  3.     if (!player) return
  4.     ToggleInfJump(player)
  5. })
  6.  
  7. Game.on("initialSpawn", (p) => {
  8.     p.keypress(async (key) => {
  9.         if (key === "space") {
  10.             if (!p.infjump) return
  11.             // adds a brick beneath where the server thinks the player is, teleports the player to where the server thinks the player is (prevents clipping through block)
  12.             let jumpbrick = new Brick(new Vector3(p.position.x - 1, p.position.y - 1, p.position.z - 1), new Vector3(2, 2, 1))
  13.             p.setPosition(p.position)
  14.             jumpbrick.visibility = 0
  15.             Game.newBrick(jumpbrick)
  16.             //waits 250ms (cause latency exists) then deletes the brick
  17.             await sleep(250)
  18.             jumpbrick.destroy()
  19.         }
  20.     })
  21. })
  22.  
  23. function ToggleInfJump(p) {
  24.     if (p.infjump) {
  25.         p.infjump = false
  26.         return
  27.     }
  28.     p.infjump = true
  29. }
  30.  
  31. function getPlayer(name) {
  32.     //totally not copied from cheats admin v2 because it works.
  33.     for (let player of Game.players) {
  34.         if (player.username.toLowerCase().indexOf(String(name).toLowerCase()) == 0) {
  35.             const victim = Array.from(Game.players).find(p => p.username === player.username)
  36.             return victim
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement