Jump to content

Requesting Skript: /tpa


Columner
 Share

Recommended Posts

 
 

Quote

import:
    org.bukkit.Bukkit
command /tpa [<text>]:
    permission: essentials.tpa
    aliases: /pcall, ptpask
    trigger:
        if length of arg-1 < 16:
            if arg-1 parsed as player is online:
                set {_arg1} to arg-1 parsed as player
                set {_tptoggle} to value of placeholder "essentials_is_teleport_enabled" from {_arg1}
                set {_Essentials} to Bukkit.getServer().getPluginManager().getPlugin("Essentials")
                set {_uuid} to uuid of player
                set {_alreadysent} to {_Essentials}.getUser({_arg1}).getTeleportRequest()
                if {_arg1} is player:
                    send "&cYou cannot teleport to yourself." to player
                else if {_tptoggle} is "no":
                    send "&c%arg-1% has teleportation disabled." to player
                else if "%{_alreadysent}%" = "%{_uuid}%":
                    send "&cYou have already sent a teleport request to &7%{_arg1}%&c."
                else:
                    execute player command "/neverusethiscommand %arg-1%"
                    send "&b%player% &9requests to teleport to you. &a<ttp:&9Click to &aaccept &9most recent teleport request.><cmd:/tpaccept>[Accept]<reset> &c<ttp:&9Click to &cdeny &9most recent teleport request.><cmd:/tpdeny>[Deny]<reset>" to {_arg1}
            else:
                send "&cPlayer not found." to player
        else if arg-1 is not set:
            send "&7Usage: /tpa <player>" to player
        else:
            send "&cPlayer not found." to player
command /tpahere [<text>]:
    permission: essentials.tpahere
    aliases: /askhere, teleporthere
    trigger:
        if length of arg-1 < 16:
            if arg-1 parsed as player is online:
                set {_arg1h} to arg-1 parsed as player
                set {_tptoggleh} to value of placeholder "essentials_is_teleport_enabled" from {_arg1h}
                set {_Essentials} to Bukkit.getServer().getPluginManager().getPlugin("Essentials")
                set {_uuidh} to uuid of player
                set {_alreadysenth} to {_Essentials}.getUser({_arg1h}).getTeleportRequest()
                if {_arg1h} is player:
                    send "&cYou cannot teleport to yourself." to player
                else if {_tptoggleh} is "no":
                    send "&c%arg-1% has teleportation disabled." to player
                else if "%{_alreadysenth}%" = "%{_uuidh}%":
                    send "&cYou have already sent a teleport request to &7%{_arg1h}%&c."
                else:
                    execute player command "/neverusethiscommand2 %arg-1%"
                    send "&b%player% &9requests you teleport to them. &a<ttp:&9Click to &aaccept &9most recent teleport request.><cmd:/tpaccept>[Accept]<reset> &c<ttp:&9Click to &cdeny &9most recent teleport request.><cmd:/tpdeny>[Deny]<reset>" to {_arg1h}
            else:
                send "&cPlayer not found." to player
        else if arg-1 is not set:
            send "&7Usage: /tpahere <player>" to player
        else:
            send "&cPlayer not found." to player

Didnt Test It Just Made It :/
If there are any errors just tell

Link to comment
Share on other sites

on load:
    delete {request::*}

command /tpa [<offline player>]:
    trigger:
        set {_p} to arg-1 
        set {_u} to uuid of arg-1
        if {_p} is online:
            if {_p} is not player:
                if {request::player::%{_u}%} is set:
                    send "&cThis player already has a active teleportation request, please wait!" to player
                    stop
                send "&2%player% &ahas requested to teleport to you! &7&o(/tpaccept to accept, automatically expires in 30 seconds)" to {_p}
                send "&aYou have requested to teleport to &2%{_p}%&a! &7&o(This will automatically expire in 30 seconds)" to player
                set {request::player::%{_u}%} to player
                wait 30 seconds
                if {request::player::%{_u}%} is set:
                    delete {request::player::%{_u}%}
                    send "&CYour teleportation request to %{_p}% &chas expired!" to player
                    send "&cYour teleportation request from %player% &chas expired!" to {_p}
            else:
                send "&cYou can't tpa to yourself!" to player
        else:
            send "&cThe specified player is currently offline!" to player

command /tpaccept:
    trigger:
        set {_u} to uuid of player
        if {request::player::%{_u}%} is set:
            set {_p} to {request::player::%{_u}%}
            if {_p} is online:
                teleport {_p} to location of player
                send "&aYour teleportation request to %player% &ahas been accepted!" to {_p}
                send "&aYou have accepted the teleportation request from %{_p}%" to player
                delete {request::player::%{_u}%}
            else:
                send "&cThis player is no longer online!"
        else:
            send "&cYou have no teleportation requests to accept!" to player
 

Edited by KJPAKA
  • Thanks 1

 

Active Minehut Player since 2016

Advanced at Skript - Know a lot about running a server 

If you need help with anything contact me @ KJPAKA#0001

 

Link to comment
Share on other sites

5 hours ago, DuckySoUnLucky said:

 
 

Didnt Test It Just Made It 😕
If there are any errors just tell

you're on minehut forums... suggesting to use skript-mirror... as well as essentials... to make a tpa command???

Edited by Ofus
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share



×
×
  • Create New...