set slot problem

  • 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.
no it didn't work. here's my entire code:
code_language.skript:
on join:
    loop all players:
        if player has permission "staff.join":
            loop-player has permission "staff.join"
            send "&3&lSTAFF &8» &b%player% &3has joined the network." to loop-player
            stop
command /staffmode:
    aliases: sm
    permission: staff.mode
    permission message: &3&lPERMISSION &8» &cYou do not have permission to execute that command.
    trigger:
        if {staffmode.%player%} is not set:
            set gamemode of player to adventure
            clear player's inventory
            wait 1 tick
            send "&3&lSTAFF MODE &8» &3You have &aenabled &3Staff mode."
            set slot 0 of player to compass named "&3Compass"
            set slot 1 of player to book named "&3Inventory Viewer"
                        set slot 2 of player to feather named "&3Flight"
            set slot 6 of player to packed ice named "&3Freeze"
            set slot 8 of player to gray dye named "&3Vanish"
            set slot 7 of player to blaze rod named "&3Random Teleporter"
            set {staffmode.%player%} to true
            stop
        else:
            send "&3&lSTAFF MODE &8» &3You have &cdisabled &3Staff mode."
            wait 1 second
            set gamemode of player to adventure
            clear player's inventory
            reveal player to all players
            delete {staffmode.%player%}
            stop
command /staffmodevanishon:
    description: Use this command to be vanished.
    permission: staff.mode
    permission message: &3&lPERMISSION &8» &cYou do not have permission to execute that command.
    aliases: smvon
    executable by: player
    trigger:
        player has permission "staff.mode"
        hide the player from all players
        send "&3&lSTAFF MODE &8» &3You are now vanished." to the player
        set the player's gamemode to adventure
command /staffmodevanishoff:
    description: Use this command to be vanished.
    permission: staff.mode
    permission message: &3&lPERMISSION &8» &cYou do not have permission to execute that command.
    aliases: smvoff
    executable by: player
    trigger:
        player has permission "staff.mode"       
        reveal the player from all players
        send "&3&lSTAFF MODE &8» &3You are no longer vanished." to the player           
on mine:
    if {staffmode::%player%} is true:
        cancel the event
            
on pickup:
    if {staffmode.%player%} is true:
        cancel the event
        
on hunger bar change:
    if {staffmode.%player%} is true:
        set the player's food level to 10
    
on damage:
    if {staffmode.%victim%} is true:
        cancel event
    if {staffmode.%attacker%} is true:
        cancel event

on break:
    if {staffmode.%player%} is true:
        cancel event


on build:
    if {staffmode.%player%} is true:
        cancel event
        
on drop:
    if {staffmode.%player%} is true:
        cancel event
on command "/v":
    if {staffmode.%player%} is true:
        cancel event
        send "&3&lSTAFF MODE &8» &cYou cannot execute that command while in Staff mode."
on command "/vanish":
    if {staffmode.%player%} is true:
        cancel event
        send "&3&lSTAFF MODE &8» &cYou cannot execute that command while in Staff mode."
on command "/v":
    if {staffmode.%player%} is true:
        cancel event
        send "&3&lSTAFF MODE &8» &cYou cannot execute that command while in Staff mode."
on command "/gm 0":
    if {staffmode.%player%} is true:
        cancel event
        send "&3&lSTAFF MODE &8» &cYou cannot execute that command while in Staff mode."
on command "/gm 1":
    if {staffmode.%player%} is true:
        cancel event
        send "&3&lSTAFF MODE &8» &cYou cannot execute that command while in Staff mode."
on command "/gm 2":
    if {staffmode.%player%} is true:
        cancel event
        send "&3&lSTAFF MODE &8» &cYou cannot execute that command while in Staff mode."
on command "/gmc":
    if {staffmode.%player%} is true:
        cancel event
        send "&3&lSTAFF MODE &8» &cYou cannot execute that command while in Staff mode."
on command "/gma":
    if {staffmode.%player%} is true:
        cancel event
        send "&3&lSTAFF MODE &8» &cYou cannot execute that command while in Staff mode."
on command "/gms":
    if {staffmode.%player%} is true:
        cancel event
        send "&3&lSTAFF MODE &8» &cYou cannot execute that command while in Staff mode."
on command "/gm c":
    if {staffmode.%player%} is true:
        cancel event
        send "&3&lSTAFF MODE &8» &cYou cannot execute that command while in Staff mode."
on command "/gm a":
    if {staffmode.%player%} is true:
        cancel event
        send "&3&lSTAFF MODE &8» &cYou cannot execute that command while in Staff mode."
on command "/gm s":
    if {staffmode.%player%} is true:
        cancel event
        send "&3&lSTAFF MODE &8» &cYou cannot execute that command while in Staff mode."
on command "/gamemode 1":
    if {staffmode.%player%} is true:
        cancel event
        send "&3&lSTAFF MODE &8» &cYou cannot execute that command while in Staff mode."
on command "/gamemode 2":
    if {staffmode.%player%} is true:
        cancel event
        send "&3&lSTAFF MODE &8» &cYou cannot execute that command while in Staff mode."
on command "/gamemode 0":
    if {staffmode.%player%} is true:
        cancel event
        send "&3&lSTAFF MODE &8» &cYou cannot execute that command while in Staff mode."
on command "/gamemode a":
    if {staffmode.%player%} is true:
        cancel event
        send "&3&lSTAFF MODE &8» &cYou cannot execute that command while in Staff mode."
on command "/gamemode c":
    if {staffmode.%player%} is true:
        cancel event
        send "&3&lSTAFF MODE &8» &cYou cannot execute that command while in Staff mode."
on command "/gamemode s":
    if {staffmode.%player%} is true:
        cancel event
        send "&3&lSTAFF MODE &8» &cYou cannot execute that command while in Staff mode."
on command "/clear":
    if {staffmode.%player%} is true:
        cancel event
        send "&3&lSTAFF MODE &8» &cYou cannot execute that command while in Staff mode."
on command "/ci":
    if {staffmode.%player%} is true:
        cancel event
        send "&3&lSTAFF MODE &8» &cYou cannot execute that command while in Staff mode."
on command "/asdunranked":
    if {staffmode.%player%} is true:
        cancel event
        send "&3&lSTAFF MODE &8» &cYou cannot execute that command while in Staff mode."
on command "/asdranked":
    if {staffmode.%player%} is true:
        cancel event
        send "&3&lSTAFF MODE &8» &cYou cannot execute that command while in Staff mode."
on command "/accept <player> [<text>]":
    if {staffmode.%player%} is true:
        cancel event
        send "&3&lSTAFF MODE &8» &cYou cannot execute that command while in Staff mode."
on command "/duel <player> [<text>]":
    if {staffmode.%player%} is true:
        cancel event
        send "&3&lSTAFF MODE &8» &cYou cannot execute that command while in Staff mode."
on command "/asdleave":
    if {staffmode.%player%} is true:
        cancel event
        send "&3&lSTAFF MODE &8» &cYou cannot execute that command while in Staff mode."
on command "/tp <player>":
    if {staffmode.%player%} is true:
        hide player to all players
on command "/spawn":
    if {staffmode.%player%} is true:
        clear player's inventory
        teleport player to {spawn}
        reveal player to all players
        delete {staffmode.%player%}
on command "/suicide":
    if {staffmode.%player%} is true:
        kill the player
        reveal player to all players
        delete {staffmode.%player%}
on quit:
    if {staffmode.%player%} is true:
        delete {staffmode.%player%}
        set gamemode of player to adventure
        clear player's inventory
        reveal player to all players
        stop
    if {staffmode.%player%} is true:
        delete {staffmode.%player%}
        stop
on place:
    if {staffmode.%player%} is true:
        cancel event
        stop
on break:
    if {staffmode.%player%} is true:
        cancel event
        stop
on inventory click:
    if {staffmode.%player%} is true:
        cancel event
        stop
    else:
        stop
        
on rightclick on player:
    if player's tool is a packed ice:
        if name of player's tool is "&3Freeze":
            if player has permission "staff.mode":
                wait 1 ticks
                execute player command "/freeze %clicked player%"
                stop
on right click:
    if player's tool is a gray dye:
        if name of player's tool is "&3Vanish":
            if player has permission "staff.mode":
                set slot 8 of player to dye:10 named "&3Vanish"
                make player execute command "/staffmodevanishon"
                delete {staffmode.%player%}
                stop

on left click:
    if player's tool is a dye:10:
        if name of player's tool is "&3Vanish":
            if player has permission "staff.mode":
                set slot 8 of player to gray dye named "&3Vanish"
                make player execute command "/staffmodevanishoff"
                stop
            
on right click on a player:
    if player's tool is a book:
        if name of player's tool is "&3Inventory Viewer":
            if player has permission "staff.mode":
                open the inventory of the clicked entity to the player
                stop

on right click with blaze rod:
    if player is holding a blaze rod named "&3Random Teleporter":
        if player has permission "staff.mode":
            set {_random} to a random player out of all players
            while {_random} is name of player:
                set {_random} to a random player out of all players
                wait 1 tick
            if {_random} is not name of player:
                teleport player 1 behind {_random}
                send "&3&lSTAFF MODE &8» &3You have been teleported to &b%{_random}%&3."
        else:
            message "&3&lPERMISSION &8» &cYou do not have permission to execute that command."

variables:
    {freeze.maincolor} = "&3"
    {freeze.seccolor} = "&b"
    {freeze.errorcolor} = "&c"
    {freeze.%player%.value} = false

on any movement:
    {freeze.%player%.value}
    cancel the event
    set {_checktime} to now
    subtract 2 seconds from {_checktime}
    {freeze.%player%.lastused} is less than {_checktime}
    message "&3&lFROZEN &8» &cYou have been frozen."
    set {freeze.%player%.lastused} to now

on command:
    {freeze.%player%.value}
    cancel the event
    message "&3&lFROZEN &8» &cYou cannot execute commands while frozen."

command /freeze [<player>]:
    trigger:
        set {_prefix} to "%{freeze.maincolor}%&lFreeze%{freeze.seccolor}%&l> %{freeze.maincolor}%"
        if player does not have permission "staff.mode":
            message "&3&lPERMISSION &8» &cYou do not have permission to execute that command."
            stop
        else:
            arg 1 is not set:
                message "&3&lUSAGE &8» &c/freeze <player>"
                stop
        {freeze.%arg 1%.value} is not set:
            set {freeze.%arg 1%.value} to false
        player is arg 1:
            message "&3&lERROR &8» &cYou cannot freeze yourself."
            stop
        not {freeze.%arg 1%.value}:
            player does not have permission "staff.mode":
                message "&3&lPERMISSION &8» &cYou do not have permission to execute that command."
                stop
            set {freeze.%arg 1%.value} to true
            set {_templastused} to now
            subtract 1 hour from {_templastused}
            set {freeze.%arg 1%.lastused} to {_templastused}
            message "&3&lFROZEN &8» &b%arg 1% &3is now frozen."
            message "&3&lFROZEN &8» &cYou are now frozen." to arg 1
            stop
        player does not have permission "staff.mode":
            message "&3&lPERMISSION &8» &cYou do not have permission to execute that command."
            stop
        set {freeze.%arg 1%.value} to false
        set {_templastused} to now
        subtract 1 hour from {_templastused}
        set {freeze.%arg 1%.lastused} to {_templastused}
        message "&3&lFROZEN &8» &b%arg 1% &3is no longer frozen."
        message "&3&lFROZEN &8» &3You are no longer frozen." to arg 1
 
I don't see anything wrong with your code. Except line 19, but I assume that indent was a paste mistake. Did you check your aliases folder?
[doublepost=1517571472,1517571426][/doublepost]I mean, I'm fairly certain 1.8 would still use "feather", but it doesn't hurt to check
 
in aliases folder, what do i look for?
[doublepost=1517572131,1517572057][/doublepost]it says it's "feather = 288"
 
Use ctrl+F and look for feather or 288. Another possible troubleshooting step you could do is set up a test command for just setting a slot to a feather so no other code is working with it. @A@ I must be missing something there.
 
the weird thing is, if i set an empty slot to be feather, it doesn't show up, however, if i set an existing slot with already an item that is working, that feather shows up and works.
[doublepost=1517572277,1517572238][/doublepost]and i did use control + f and searched feather
 
whoa, that's super weird. >.< I know format and set slot is buggy for gui's, it may be a bug that's causing the issue now. Are you able to set slot 2 to something else and then right after it, reset it to a feather as a potential work around?
 
i tried arrow before but just like feather, nothing shows up.
[doublepost=1517572482,1517572431][/doublepost]should i create a separate .sk file and kind of connect that one to this one for the feather? will that work/.
 
oh, should i just set up a random command and just make it so a feather is set in the inventory to see if it works?
[doublepost=1517572650,1517572611][/doublepost]as you saw if was a staffmode skript, i just wanted to add a feather that when you right click it executes /fly xD
 
Try this, so like im thinking maybe it can set it to something that does work and then rese it to the feather
code_language.skript:
command /s:
    trigger:
        set slot 0 of player to stone
        set slot 0 of player to feather
It's being such a pain for something as simple as fly haha
 
huh...that's weird... i just did this:

code_language.skript:
command /test:
    trigger:
        set slot 2 of player to feather
and this worked...
[doublepost=1517573045,1517573002][/doublepost]but the other one didn't...
is there a way to make it so that, upon executing an existing command, that you set the slot of a player to an item?
 
still works even if i name it
code_language.skript:
command /test:
    trigger:
        set slot 2 of player to feather named "&7Hello"
 
perhaps this.
code_language.skript:
on command /staffmode:
    set slot 2 of player to feather named "&7Hello"
 
exactly what i typed
code_language.skript:
on command /staffmode:
    set slot 2 of player to feather named "&7Hello"
but still doesnt work -.-
[doublepost=1517573638,1517573432][/doublepost]i have to go to sleep now, hopefully when i wake up, you can still be willing tohelp me xD goodnight
 
exactly what i typed
code_language.skript:
on command /staffmode:
    set slot 2 of player to feather named "&7Hello"
but still doesnt work -.-
[doublepost=1517573638,1517573432][/doublepost]i have to go to sleep now, hopefully when i wake up, you can still be willing tohelp me xD goodnight
I should rest too lol. Fresh eyes will probably be a good idea. x3 night and take care!
 
just use the numerical id, skript will give you a warning not to use it and even give you the alias to use instead, but if you use the alias it tells you to use and it still doesn't work then its not worth the headache so just using the numerical id should be fine
 
should I be using the latest supported version of 1.8 instead of the latest version of skript since my server is 1.8 or does that not make a difference?
 
Status
Not open for further replies.