# ClickTP

## Source Code (V1.0.0)

<details>

<summary><a href="https://cdn.discordapp.com/attachments/1119691421734154332/1119691421977432205/ClickTP.js">ClickTP.js</a> (Click Link to Download)</summary>

```javascript
// gimhook: {"name":"ClickTP","description":"A mod that lets you teleport to where you shift-click!","version":"1.0.0","author":"Blackhole927","license":"MIT"}
(() => {
  gimhook.addHook("join", () => {
      console.log("Game joined!")
      console.log("Test...")
      var w = 0
      var h = 0
      var clickTPon = false;
      onmousemove = function(e) {
          w = window.innerWidth
          h = window.innerHeight
          mouseX = e.clientX
          mouseY = e.clientY
          mouseX -= w/2
          mouseX = mouseX/(w)
          mouseY -= h/2
          mouseY = mouseY/h
          zoom = gimhook.graphics.camera.getZoom()
          zoom = 1/zoom
          mouseX *= zoom
          mouseY *= zoom
          mouseX *= 2
          mouseY *= 2

      }
      onmousedown = function(e) {
          if (e.shiftKey) {
              xy = gimhook.graphics.player.getPosition()
              xy["x"] += mouseX*(w/2)
              xy["y"] += mouseY*(h/2)
          }

          gimhook.graphics.player.setPosition(xy["x"], xy["y"])
      }
  });
})();
```

</details>

## How to Use It

After installing the mod, hold down `SHIFT` while clicking with your mouse. You will move in the direction of your mouse.

## Changelog

| Version | Changes                                        |
| ------- | ---------------------------------------------- |
| v1.0.0  | Added shift-click teleportation functionality. |
