How to make a player's screen shake

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!


    You can always check out skUnity Downloads for downloads and any other information about Skript!

Jul 18, 2023
Hi there! Is it possible to make a player's screen shake with Skript? If it is, please let me know.

Things I've tried:

Teleporting the player to themselves
Lagging the server a bit
Constantly killing the player and teleporting them in the same location
You can teleport them to themself but change the yaw and pitch slightly on every teleport (works best with random numbers in a certain range for yaw and pitch so it doesn't change much but doesn't seem repetitive)
The setting of the local variables isn't necessary you can use player's x/y/z-coordinate/player's world in the function directly, this just makes it a little more organized.

The point is, this command will set the player's yaw and pitch both to 0. Simple change the last two 0's at the end to adjust their yaw and pitch.

command shake:
        set {_x} to player's x-coordinate
        set {_y} to player's y-coordinate
        set {_z} to player's z-coordinate
        set {_w} to player's world
        teleport player to location({_x}, {_y}, {_z}, {_w}, 0, 0)