#How can we add a teleport request system when argument 1 is set?
1 messages · Page 1 of 1 (latest)
if event-slot is 10:
I would not check the slots because right now I have no idea what the item is. for additional context and ease just check the name or NBT
i would also use skript to create kits
@crimson cedar Thank You. Sir I want to make a teleport request system when player does /arena player it open the following gui and when it is clicked the player gets sent a teleport request and upon accepting it the player gets teleported.
@crimson cedar Can you tell how to make it a global one?
remove the _
soo like both players have to accept and then they get teleported to a place?
the executor [with perms] will send the teleport request for the arena
and the player who gets the request has option of accepting it and rejecting it.
The executor will use the command /arena player which will open a gui for him which I have created to send request to the player he wants to get into that arena
Got it sir?
trigger:
set {argument} to argument 1
set {_arena} to chest inventory with 3 rows named "&1&lPrivate Arenas"
set slot integers from 0 to 26 of {_arena} to black stained glass pane named " "
set slot 10 of {_arena} to netherite sword named "&6&lNetherite Pot" with lore "&o&bClick To Teleport" with all flags hidden
set slot 12 of {_arena} to diamond axe named "&6&lAxe & Shield" with lore "&o&bClick To Teleport" with all flags hidden
set slot 14 of {_arena} to end crystal named "&6&lCrystal PvP" with lore "&o&bCLick To Teleport" with all flags hidden
set slot 16 of {_arena} to diamond sword named "&6&lTank" with lore "&o&bClick To Teleport" with all flags hidden
open {_arena} to player
on inventory click:
if name of event-inventory is "&1&lPrivate Arenas":
if event-item is black stained glass pane:
cancel event
if event-slot is 10:
if player has permission "private.arena.netheritepot":
if {argument} is not set:
clear inventory of player
clear all the potion effects of player
heal player
execute console command "easykits give NetheritePot %player%"
teleport player to {netheritespawn}
cancel event
if {argument} is set:
clear inventory of {argument}
clear all the potion effects of {argument}
heal {argument}
execute console command "easykits give NetheritePot %{argument}%"
teleport {argument} to {netheritespawn}
cancel event
close inventory of player
else:
send "&cYou don't have the permission to use this."
close inventory of player```
Here's what I have coded it works but I want a teleport system as mentioned above.
so its like a /duel <player> command and one the arument player accepts they are put in an arena?
also, if you just use {argument} this variable can only ever hold 1 value; if another uses the command before the argument accepts it will mess things up
but the other player without perms can't do that
oh I see
any fix for this sir?
you can set it per player; {something::%player's uuid%}, but you could also use metadata in this scenario
also please turn off reply pings
from what i understand you want this:
- Person A uses
/arena Person B - Person B accepts Person A's arena request
- Person A and Person B are teleported to an arena
The last point is not accurate
Person A can be alone in arena too
it is not exactly like a /duel
From the current skript Person A can tp him as well as Person B
But it might lead to abuse of perms at Person A can force tp Person B
that's why I need a teleport request system.
So Person A will always be able to enter themselves at any time
Yes Sir.
And that can be done using the current skript as I mentioned
but I need a tp request system sir.
I would set a metadata tag for the argument;
set (Person A)'s metadata tag "arenaRequest" to (Person B)
Person B accepts/declines request:
accept:
set (Person A)'s metadata tag "arenaAccepted" to (Person A)'s metadata tag "arenaRequest"
# = Person B
delete (Person A)'s metadata tag "arenaRequest"
decline:
delete (Person A)'s metadata tag "arenaRequest"
Teleport them:
teleport (Person A)
if (Person A)'s metadata tag "arenaRequest is set:
teleport (Person A)'s metadata tag "arenaRequest"
# = Person B
delete (Person A)'s metadata tag "arenaRequest"```
where can I learn about metadata tag sir?
https://forums.skunity.com/threads/metadata-tags.13846/
https://sovdee.gitbook.io/skript-tutorials/core-concepts/variables/memory-variables-metadata-and-alternatives#metadata
Metadata Tags
Introduction
Metadata tags are a form of temporary value storage, where you tie a value to a block or entity and that value will be wiped when the server restarts. This is convenient for holding information about a entity or block where you don't have to worry about removing it...
huh i am not able to get it
Can you please help me add it.
this has the majority of it
Do I need to make a separate command for it?
to accept? a command is probably the best way to do that
I have multiple arenas so that's why I am asking.
person A specifies the arena when they send the request?
Person A can use /arena Person B which opens a gui in which options for various arenas will be there
Which i have coded
but I need an arena tp request
okay, so i guess when they click on it you should keep track of the arena
and make the metadata tag reflect that
Keep track of the inventory slot right?
or the name
if player has permission "private.arena.netheritepot":
set metadata tag "netheritepot" of player to true
if {argument} is not set:
clear inventory of player
clear all the potion effects of player
heal player
execute console command "easykits give NetheritePot %player%"
teleport player to {netheritespawn}
cancel event
if {argument} is set:
if {argument} is online:
clear inventory of {argument}
clear all the potion effects of {argument}
heal {argument}
execute console command "easykits give NetheritePot %{argument}%"
teleport {argument} to {netheritespawn}
cancel event
close inventory of player```
like this metadata tag?
You arent using metadata, still using a variable
Metadata is automatically player-specific
But you could also use a variable if you prefer that
trigger:
set {argument} to argument 1
if {argument} is not player:
set {_arena} to chest inventory with 3 rows named "&1&lPrivate Arenas"
set slot integers from 0 to 26 of {_arena} to black stained glass pane named " "
set slot 10 of {_arena} to netherite sword named "&6&lNetherite Pot" with lore "&o&bClick To Teleport" with all flags hidden
set slot 12 of {_arena} to diamond axe named "&6&lAxe & Shield" with lore "&o&bClick To Teleport" with all flags hidden
set slot 14 of {_arena} to end crystal named "&6&lCrystal PvP" with lore "&o&bCLick To Teleport" with all flags hidden
set slot 16 of {_arena} to diamond sword named "&6&lTank" with lore "&o&bClick To Teleport" with all flags hidden
open {_arena} to player
else:
send "&cYou cannot send teleport request to yourself."
on inventory click:
if name of event-inventory is "&1&lPrivate Arenas":
if event-item is black stained glass pane:
cancel event
if event-slot is 10:
if player has permission "private.arena.netheritepot":
if {argument} is not set:
clear inventory of player
clear all the potion effects of player
heal player
execute console command "easykits give NetheritePot %player%"
teleport player to {netheritespawn}
cancel event
if {argument} is set:
if {argument} is online:
send "&bYou sent a teleport request to %{argument}%" to player
send "&bYou received a teleport request from %player% for Netherite Pot Arena" to {argument}
send "<tooltip:&aClick to Accept.>&a&lAccept" to {argument}
send "<tooltip:&cClick to Reject.>&c&lReject" to {argument}
close inventory of player
cancel event
else:
send "&cPlayer is not online"
close inventory of player
cancel event
else:
send "&cYou don't have the permission to use this."
close inventory of player
cancel event```
I have done this what next sir?
why do u set a valuble to argument 1 just use arg 1
It was showing errors when I used arg-1 and it asked me to use argument 1 instead
I think it was due to SkBee
what no skbee wil not ask u to make a valuble insted of useing arg-1
Oh I updated the skript that's why
here's the latest one sir.
yeah thats the lates skript u made its not the error where it says it wants a valuble
Sir I am not lying with the error.
I need a solution for the teleport system
i was never saying u are lying i just think u dont know how to read an error
this wil work
u do not need a global variable or a local variable to say arg-1
and if u only have 1 argument u can just use arg
I used the same but it showed an error and asked me to use argument 1 instead of args-1
I will try to send the error
and u can just remove the if event-item is black stained glass pane: u dont want them to be ablel to get all the other stuff out
yeah
args-1 is not a thing
without the s
u can just cancel event after checking if the name is name
Thanks for helping sir.
for black stained glass slots?
ohhh
I get it sir. Thanks!
trigger:
set {argument} to arg-1
if {argument} is not player:
set {_arena} to chest inventory with 3 rows named "&1&lPrivate Arenas"
set slot integers from 0 to 26 of {_arena} to black stained glass pane named " "
set slot 10 of {_arena} to netherite sword named "&6&lNetherite Pot" with lore "&o&bClick To Teleport" with all flags hidden
set slot 12 of {_arena} to diamond axe named "&6&lAxe & Shield" with lore "&o&bClick To Teleport" with all flags hidden
set slot 14 of {_arena} to end crystal named "&6&lCrystal PvP" with lore "&o&bCLick To Teleport" with all flags hidden
set slot 16 of {_arena} to diamond sword named "&6&lTank" with lore "&o&bClick To Teleport" with all flags hidden
open {_arena} to player
else:
send "&cYou cannot send teleport request to yourself."
on inventory click:
if name of event-inventory is "&1&lPrivate Arenas":
cancel event
if event-slot is 10:
if player has permission "private.arena.netheritepot":
if {argument} is not set:
clear inventory of player
clear all the potion effects of player
heal player
execute console command "easykits give NetheritePot %player%"
teleport player to {netheritespawn}
if {argument} is set:
if {argument} is online:
send "&bYou sent a teleport request to %{argument}%" to player
send "&bYou received a teleport request from %player% for Netherite Pot Arena" to {argument}
send "<tooltip:&aClick to Accept.>&a&lAccept" to {argument}
send "<tooltip:&cClick to Reject.>&c&lReject" to {argument}
close inventory of player
else:
send "&cPlayer is not online"
close inventory of player
else:
send "&cYou don't have the permission to use this."
close inventory of player
There's the updated skript sir.
but yeah if u want your tp requst thing to be in a gui u can do it with a variable with value of arg
but pls make it the players only like {request::%uuid of player%}
and like x8ight sayed its a good ider to make your own kit system with skript bc doing it from console command wil spam your console
ok i was just reading all the other texts in here and i was playing with metadata bc i normaly dont use it but now i know how to use it.
so want i wil do is make a new text argument on your arana so it wil be command /arena [<text>] [<player>]: and maybe makeing the permission on the command so they are not just opening a gui they can do anything with
Yes sir I will add it soon.
Sir if possible can you please add that to my current skript?
Like the metadata and stuff I have no idea to to put them and use it.
why [<text>] there?
Is the string for the arena? I thought that was being specified through the gui
Can just set metadata/var on inv click
trigger:
set {argument} to argument 1
if {argument} is not player:
set {_arena} to chest inventory with 3 rows named "&1&lPrivate Arenas"
set slot integers from 0 to 26 of {_arena} to black stained glass pane named " "
set slot 10 of {_arena} to netherite sword named "&6&lNetherite Pot" with lore "&o&bClick To Teleport" with all flags hidden
set slot 12 of {_arena} to diamond axe named "&6&lAxe & Shield" with lore "&o&bClick To Teleport" with all flags hidden
set slot 14 of {_arena} to end crystal named "&6&lCrystal PvP" with lore "&o&bCLick To Teleport" with all flags hidden
set slot 16 of {_arena} to diamond sword named "&6&lTank" with lore "&o&bClick To Teleport" with all flags hidden
open {_arena} to player
else:
send "&cYou cannot send teleport request to yourself."
on inventory click:
if name of event-inventory is "&1&lPrivate Arenas":
cancel event
if event-slot is 10:
if player has permission "private.arena.netheritepot":
if {argument} is not set:
clear inventory of player
clear all the potion effects of player
heal player
execute console command "easykits give NetheritePot %player%"
teleport player to {netheritespawn}
if {argument} is set:
if {argument} is online:
send "&bYou sent a teleport request to %{argument}%" to player
send "&bYou received a teleport request from %player% for Netherite Pot Arena" to {argument}
send "<tooltip:&aClick To Accept><command:>&aAccept <reset>&bor<reset> <tooltip:&cClick To Deny><command:>&cDeny" to {argument}
close inventory of player
else:
send "&cPlayer is not online"
close inventory of player
else:
send "&cYou don't have the permission to use this."
close inventory of player
x8ight I want to add some effects when player clicks on the text "<tooltip:&aClick To Accept><command:>&aAccept <reset>&bor<reset> <tooltip:&cClick To Deny><command:>&cDeny"
How can I do that?
i think theres a way to make the player execute a command, but i don't remember it off the top of my head
This video is made in 1.17 (June 2021)
In this video I show how to use the JSON Format to customise chat messages using skript.
💙Follow me on twitter ➤ https://twitter.com/FanStaaff
🧡Follow me on Instagram ➤ https://instagram.com/FanStaaff
💜Join ...
Yes.
yeah, this shows how
But that's only for command
i suppose you could just make a command that give the effects
effects like clear inventory etc etc
honestly since youre doing that twice i would use a function
as in?
@crimson cedar Sorry for the ping but dm?
if name of event-inventory is "&1&lPrivate Arenas":
cancel event
if event-slot is 10:
if player has permission "private.arena.netheritepot":
if {argument} is not set:
clear inventory of player
clear all the potion effects of player
heal player
execute console command "easykits give NetheritePot %player%"
teleport player to {netheritespawn}
if {argument} is set:
if {argument} is online:
set {atp::netherite::%uuid of player%} to true
set {atp::axe&shield::%uuid of player%} to false
set {atp::cpvp::%uuid of player%} to false
set {atp::tank::%uuid of player%} to false
close inventory of player```
Will this work @spare aurora ?
maybe? if u dont ping it wil maybe
try it
you made another post so i though it was solved there
THANK YOU GUYS!
can you elaborate on that?
Can you please check if there are any errors coz they aren't getting flagged and the skript is working sometimes only.
Here's the skript.
I think it is probably related to my metadata tags.
But please check sir.
this takes up a lot of space, i would just do something likecommand setspawn <string>: trigger: set {spawn::%arg-1%} to block at player's location
using the block is a quick way to get perfect coords for the centre of the block and yaw/pitch of 0
You still have the {argument} but it's not player-specifc.
if you don't specify the player somewhere any time someone uses the command {argument} will bet set to the argument they inputted, and you will lose the last one
How can I specify then?
Like what should it be then
The uuid in the variable or metadata
Like in this example
probably
let me test it now!
Sir I tried but it won't teleport player when arg-1 is set
Here's the skript with changes. Can you please tell me what's the error?
Any solution to this?
have you debugged?
I tried but idk how to
I am noob at this 😦
Here's the problem
So sometimes it works [player sends tp request player receives and player accept] but sometimes [player sends tp request but it sends multiple like of different arenas and player isn't able to accept it like player clicks on the accept button but it doesn't do anything]
Like in this case it worked!
But in this case, It sent request of some other arena too and the accept button didn't work
I got the problem
So when Player A clicks on the gui to select an arena to send a teleport request to Player B, it sets value of for example {arena::netherite::uuid of player%] to true for the Player A
