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!
You can always check out skUnity Downloads for downloads and any other information about Skript!
on inventory click:
if "%inventory name of player's current inventory%" is " &0Player Stats":
cancel event
if clicked slot is 13:
play sound "ITEM_BREAK" to player with volume 3 and pitch 1
on first join:
set {Mysql._joined.%player%} to true
set {Mysql._jtime.%player%} to now
stop
command /stats [<offline player>]:
usage: /stats
trigger:
arg-1 is not set:
send "nop"
stop
set {_player} to "%player%"
if {Mysql._joined.%arg-1%} is true:
arg-1 is set:
broadcast "test"
if arg-1 has permission "tag.owner":
broadcast "test2"
open chest with 3 rows named " &0Player Stats" to player
set slot 13 of player's current inventory to arg-1's skull named "&4&l&n%arg-1%" with lore "test"
else if arg-1 has permission "tag.admin":
broadcast "test2"
open chest with 3 rows named " &0Player Stats" to player
set slot 5 of player's current inventory to feather named "&c&l&n%arg-1%" with lore "test"
else:
open chest with 3 rows named " &0&nPlayer Stats" to player
set slot 5 of player's current inventory to feather named "&1%arg-1%" with lore "never joined!"
command /addperm <text> <offline player>:
trigger:
set {tag.%arg-1%.%arg-2%} to true
#then later on in the gui part replace "if arg-1 has permission "tag.owner" with
if {tag.whatever.%arg 1%} is true:
#the stuff after the permission check
if {mysql_.srt.%arg-1%} is true:
$ thread
set {_amount} to checkMoney(arg-1)
open chest with 3 rows named " &0&nPlayer Stats" to player
set slot 13 of player's current inventory to arg-1's skull named "%arg-1%" with lore "%{_amount}%"
function checkMoney(target: offline player) :: number:
set {_result::*} to objects in column "amount" from result of query "SELECT amount FROM money WHERE uuid = '%uuid of {_target}%'" and close
set {_amount} to "%{_result::*}%" parsed as number
"%{_result::*}%" is "<none>":
update "INSERT INTO money (`uuid`, `amount`) VALUES ('%uuid of {_target}%', '0')"
set {_amount} to 0
return {_amount}