Solved Pickupable items from skript gui

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

VojaFTW

Member
Jun 10, 2017
42
2
0
Hello, i coding some sort of reward system and i don't know how to make items pickuable from gui and when no items in gui to close and with cooldown timer and random loot.

my current code:
code_language.skript:
command /fkit:
    trigger:
        open chest with 1 row named "&cFKit loot" to player
        wait 1 tick
        format slot 0 of player with feather named "&3Soon" with lore "&aComing Soon"

this is test version of command and im stuck with problem of pickuping items from gui.

- thanks in advance

[doublepost=1499635354,1499626986][/doublepost]and how make when player click on item in gui to remove specific amount and named item??
 
I would use "set slot" instead of format from the addon skellet. It works better for taking items out of an inventory. Like this:

set slot 0 of player's current inventory with feather named "&3Soon" with lore

I think it'd be easier to have it set to the amount you want them to have for each reward and then put a cool down on the command itself, like : "...with 10 feather named...". Skript comes with a simple cooldown example in it's config. There's probably a better way but I like using that one for its simplicity. To randomize the loot you could do something like this maybe:
https://pastebin.com/FxkGA0Qr
 
I would use "set slot" instead of format from the addon skellet. It works better for taking items out of an inventory. Like this:

set slot 0 of player's current inventory with feather named "&3Soon" with lore

I think it'd be easier to have it set to the amount you want them to have for each reward and then put a cool down on the command itself, like : "...with 10 feather named...". Skript comes with a simple cooldown example in it's config. There's probably a better way but I like using that one for its simplicity. To randomize the loot you could do something like this maybe:
https://pastebin.com/FxkGA0Qr

but you don't solve my problem how to remove specific amount of named item in player inventory when player click in item in gui
 
I would use "set slot" instead of format from the addon skellet. It works better for taking items out of an inventory. Like this:

set slot 0 of player's current inventory with feather named "&3Soon" with lore

I think it'd be easier to have it set to the amount you want them to have for each reward and then put a cool down on the command itself, like : "...with 10 feather named...". Skript comes with a simple cooldown example in it's config. There's probably a better way but I like using that one for its simplicity. To randomize the loot you could do something like this maybe:
https://pastebin.com/FxkGA0Qr
set slot is from vanilla skript
 
i;m currently to that on another way and here is my code but now item start be pickupable and not removing item

code_language.skript:
command /test:
    executable by: console
    trigger:
        remove 10 magma cream named "&e&lSkenia Token" from player's inventory

    if player has 10 magma cream:
        open chest with 1 row named "&cSkenia rankup" to player
        wait 1 tick
        format slot 0 of player with iron block named "&aMegabit" with lore "&7Upgrade to megabit || &eCost&7: &a10 Skenia Tokens" to close then run [execute console command "/updaterank %player% ULTRA"]->[execute console command "/test"]
        format slot 1 of player with 166 named "&aGigabit" with lore "&7Upgrade to gigabit || &eCost&7: &a20 Skenia Tokens" to be unstealable      
        format slot 2 of player with 166 named "&aTerabit" with lore "&7Upgrade to terabit || &eCost&7: &a30 Skenia Tokens" to be unstealable
        format slot 3 of player with 166 named "&aPetabit" with lore "&7Upgrade to petabit || &eCost&7: &a40 Skenia Tokens" to be unstealable
 
guysss are you chating about skript or solving my problem???? if you guys here to chat just leave the problem to someone try to fix and if you do that post count spam is prevented.
 
i;m currently to that on another way and here is my code but now item start be pickupable and not removing item

code_language.skript:
command /test:
    executable by: console
    trigger:
        remove 10 magma cream named "&e&lSkenia Token" from player's inventory

    if player has 10 magma cream:
        open chest with 1 row named "&cSkenia rankup" to player
        wait 1 tick
        format slot 0 of player with iron block named "&aMegabit" with lore "&7Upgrade to megabit || &eCost&7: &a10 Skenia Tokens" to close then run [execute console command "/updaterank %player% ULTRA"]->[execute console command "/test"]
        format slot 1 of player with 166 named "&aGigabit" with lore "&7Upgrade to gigabit || &eCost&7: &a20 Skenia Tokens" to be unstealable     
        format slot 2 of player with 166 named "&aTerabit" with lore "&7Upgrade to terabit || &eCost&7: &a30 Skenia Tokens" to be unstealable
        format slot 3 of player with 166 named "&aPetabit" with lore "&7Upgrade to petabit || &eCost&7: &a40 Skenia Tokens" to be unstealable
Like Wynnevir said, you really shouldnt use format slot but if you have your heart set on it heres part of the problem:

You're executing a command from console which doesnt have a player to fill in for 'player's inventory' in line 4 since youre executing the command from console so you need to add a player argument and then instead of 'player's inventory' youll have 'arg-1's inventory'
 
Like Wynnevir said, you really shouldnt use format slot but if you have your heart set on it heres part of the problem:

You're executing a command from console which doesnt have a player to fill in for 'player's inventory' in line 4 since youre executing the command from console so you need to add a player argument and then instead of 'player's inventory' youll have 'arg-1's inventory'

ty i go to test it if doesn't work i post there and are you know ho make a pickupable items from gui using format slot?
[doublepost=1499721839,1499721395][/doublepost]are i'm doing something wrong and items is pickupable again???

code_language.skript:
command /test <player>:
    executable by: console
    trigger:
        remove 10 magma cream named "&e&lSkenia Token" from arg-1's inventory

        format slot 0 of player with iron block named "&aMegabit" with lore "&7Upgrade to megabit || &eCost&7: &a10 Skenia Tokens" to close then run [execute console command "/updaterank %player% ULTRA"]->[execute console command "/test %player%"]
[doublepost=1499723025][/doublepost]yay i fix the problem with removing items only thing i need to do to fix is to make [<player>] not <player> now starting working on bug with pickupable items for another gui.

thanks you guys for the help
 
Status
Not open for further replies.