From %arg-1% to string

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

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

Status
Not open for further replies.

Lukkeeh

Member
Jun 24, 2017
11
0
1
26
So i wanna make a practise plugin. I want to make so i can /<command> list and all arenas i create will be shown in a gui. It is hard and i dont get how i could do this. bcs if i do %arenalists::%arg-2% that doesn't know what arg 2 is in that sentence please help.



if arg-1 is "create":
set {arena.%arg-2%} to true
send "&c&lPractise &c>> &c%arg-2% &9has been created!"
set {arena.%arg-2%} to {arenalists::%arg-2%}
if arg-1 is "list":
open chest with 2 rows named "&8Arenas" to player
wait 2 ticks
format slot 0 of player with barrier named "&c%arenalists::%arg-2%" to close then run
 
command /practise [<text>][<text>][<text>]:
permission: admin.practise
permission message: &c&lError
aliases: /p
trigger:
if arg-1 is not set:
send "&9 &c&lPractise help&9 " to player
send "" to player
send "&9/p create &c[MapName] &7: Creates the arena." to player
send "&9/p setspawn &c[MAPNAME] [1 - 2] &7: Sets the spawnpoint on each side of the arena." to player
send "&9/p spawn &c[Kiteditor / spawn]&7: Sets the spawnpoint on every player." to player
send "&9/p event &c[EventName] &7: Creates an event! use /events to check every events!" to player
send "&9/p editchest &c[1 - 2] &7: Gives u a chest to place to set the kit editor chests." to player
send "&9/p list &7: Check every arena's name!" to player
if arg-1 is "create":
set {arena.%arg-2%} to true
send "&c&lPractise &c>> &c%arg-2% &9has been created!"
make player execute "/arenalist %arg-2%"
if arg-1 is "list":
open chest with 2 rows named "&8Arena list" to player
wait 2 ticks
format slot 0 of player with grass named "&c%arena-1%" to close then run
 
command /practise [<text>][<text>][<text>]:
permission: admin.practise
permission message: &c&lError
aliases: /p
trigger:
if arg-1 is not set:
send "&9 &c&lPractise help&9 " to player
send "" to player
send "&9/p create &c[MapName] &7: Creates the arena." to player
send "&9/p setspawn &c[MAPNAME] [1 - 2] &7: Sets the spawnpoint on each side of the arena." to player
send "&9/p spawn &c[Kiteditor / spawn]&7: Sets the spawnpoint on every player." to player
send "&9/p event &c[EventName] &7: Creates an event! use /events to check every events!" to player
send "&9/p editchest &c[1 - 2] &7: Gives u a chest to place to set the kit editor chests." to player
send "&9/p list &7: Check every arena's name!" to player
if arg-1 is "create":
set {arena.%arg-2%} to true
send "&c&lPractise &c>> &c%arg-2% &9has been created!"
make player execute "/arenalist %arg-2%"
if arg-1 is "list":
open chest with 2 rows named "&8Arena list" to player
wait 2 ticks
format slot 0 of player with grass named "&c%arena-1%" to close then run
Awesome thanks, Ok I'm just going thru this in my code, curious, did you do this on purpose
"format slot 0 of player with grass named "&c%arena-1%" to close then run"
Because arena-1 is not a proper expression. Was it meant to be arg-1?

Also, after "to close and run" you need to put a command in there,
"format slot %number% of %players% with %item stack% to close then run %text%"
something like
"to close and run "/some command"
 
Last edited:
Status
Not open for further replies.