Hello, im working on a homes GUI, and im having a little trouble with the teleporting part. Im use to using Tuske, and i updated my server, and it no longer works. So, im remaking it in vanilla skript now. How can i get the name of the slot the player picks, and then teleport them to that home? Here is the whole code. If anyone knows how to get this to work, please let me know ASAP.
Thanks!
~Matt
Thanks!
~Matt
Code:
on first join:
set {maxhomes::%player%} to 0
command /sethome [<text>]:
trigger:
if arg-1 isn't set:
send "&7[&aHomes&7] &7You must have a home name!"
else:
if {HOME::%player%::*} contains arg-1:
send "&7[&aHomes&7] &7You already have a home named that!"
set {LOC::HOME::%player%::%arg 1%} to player's location
add arg-1 to {HOME::%player%::*}
set {HCOL::%player%::%arg 1%} to "&c&l"
send "&7[&aHomes&7] &7You set a home named %arg-1%&7!"
command /delhome [<offlineplayer>]:
trigger:
if player has permission "%{SKHOME::DB::PERM::DELH}%":
if arg-1 is set:
delete {HOME::%arg-1%::*}
send "&7[&aHomes&7] &7You deleted all of %arg-1%&7's homes!"
command /homes:
trigger:
open chest inventory with 6 rows named "&c&lHomes(s)" to player
set {_o} to 0
loop 55 times:
set slot {_o} of player's current inventory to gray glass pane named ""
add 1 to {_o}
if size of {HOME::%player%::*} is bigger than 0:
set {_home} to 0
loop {HOME::%player%::*}:
set {_ahome} to loop-value
set slot {_home} of player's current inventory to chest named "%{HCOL::%player%::%{_ahome}%}%%{_ahome}%"
add 1 to {_home}
on inventory click:
if "%event.getView().getTitle()%" = "&c&lHomes(s)":
cancel event
set {_var} to 0
loop 66 times:
add 1 to {_var}
set {_name} to loop-value
teleport player to {LOC::HOME::%player%::%{_name}%}