Paste #111865: Unnamed Denizen Script Paste

Date: 2023/07/02 18:02:01 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


cutscene:
    type: command
    name: cutscene
    debug: true
    description: A custom cutscene script for fariasmp
    usage: /cutscene
    permission message: Sorry!
    script:
          - if <player.has_flag[cutscene]>:
            - run exitcutscene
          - else:
            - run startcutscene



exitcutscene:
    type: task
    script:
      - narrate cutscene stopped
      - flag <player> cutscene:!

      #return to saved location when cutscene is exited.
      - teleport <player> <player.flag[location]>

      # remove the old location flag now it's used

      - flag <player> location:!

      #put back in gms when cutscene is ended
      - adjust gamemode survival


startcutscene:
    type: task
    script:
      # save current location so we can return to it
      - flag <player> location:<player.location>


      # flag them as cutscene active
      - flag <player> cutscene
      # put the player in gmsp
      - adjust gamemode spectator

      - wait 5s
      - run exitcutscene


cutscenehandler:
    type: world
    debug: false
    events:


      # block all commands when cutscene is running
      on command:
      - if <player.has_flag[cutscene]>:
        - determine FULFILLED




      # if they join and they didnt leave the cutscene properly, force kick them out.
      on player joins:
      - if <player.has_flag[cutscene]>:
        - run exitcutscene