1. 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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

TPA System

Discussion in 'Requests' started by Cupex, Oct 17, 2021.

  1. Cupex

    Cupex Member

    Joined:
    Feb 16, 2020
    Messages:
    36
    Likes Received:
    1
    Category: TPA System

    Suggested name: TPA.sk

    Spigot/Skript Version: 1.8 / 2.2-dev25

    What I want:
    I would like to have a TPA system that works like this:
    The command /tpa (player) sends the other player a tpa request. This player then has 30 seconds to accept them. If this is not the case, the request becomes invalid and the player can no longer accept it and you have to send a new request. If the player who sent the request leaves the server, the request is automatically deleted and the player who received the request receives a message that the player has left the server and the request has become invalid.
    During the time the player is teleported if the request has been accepted, the player may not move (for 3 seconds). If he moves, the teleportation is canceled and you have to send a new request. The command /tpdeny rejects the request. The command /tpatoggle is used to deactivate or activate the function. If you deactivate it, nobody can send a request anymore.


    Ideas for commands: /tpa (player), /tpaccept, /tpdeny, /tpatoggle, /tpahere

    Ideas for permissions: none

    When I'd like it by: If possible before October 20th
     
  2. Mapz

    Mapz Member

    Joined:
    Oct 15, 2021
    Messages:
    2
    Likes Received:
    0
    Sorry friend but I could not continue with the script due to time issues, if someone who sees this wants to help you feel free to take the code and fix/edit it


    Code (Text):
    1. command /tpa [<player>]:
    2.     trigger:
    3.         if arg-1 is set:
    4.             send "&a[!] Tp send correctly"
    5.             send "&a[!] You have a tpa request from: &2%sender%" to arg-1
    6.             send "&8- &7Use &f/tpaccept &7to accept the tp!"
    7.             send "&8- &7Use &f/tpdeny &7tp deny the tp!"
    8.             set {tpa.pending.%arg-1%} to arg-1
    9.             set {tpa.sender.%sender%} to player
    10.         if arg-1 is not set:
    11.             send "&c[!] You must put some nick! &e/tpa (player)"
    12.             stop
    13.        
    14. command /tpaccept:
    15.     trigger:
    16.         if {tpa.pending.%player%} is set:
    17.             send "&a[!] Tp accepted"
    18.             wait 5 ticks
    19.             teleport {tpa.sending.%player%} to sender
    20.             wait 1 tick
    21.             delete {tpa.sending.%player%}
    22.             delete {tpa.sender.%sender%}
    23.             stop
    24.         if {tpa.pending.%player%} is not set:
    25.             send "&c[!] You dont have any request of tp :(."
    26.             stop
    27.            
    28. command /tpdeny:
    29.     trigger:
    30.         if {tpa.pending.%player%} is set:
    31.             send "&c[!] You denied the tp."
    32.             wait 1 tick
    33.             delete {tpa.sending.%player%}
    34.             delete {tpa.sender.%sender%}
    35.             stop
    36.         if {tpa.pending.%player%} is not set:
    37.             send "&c[!] You dont have any request of tp :(."
    38.             stop
     

Share This Page

Loading...