Please help me fix this

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

kaposzta99

Member
Aug 13, 2020
2
0
0
22
Im trying to make a crate opening skript.
The code:
options:
{lada:1} = 322 8
{lada:2} = 373:8201
{lada:3} = 322:1
{lada:4} = 332 12

on right click with 131:
if clicked block is end portal frame:
cancel event
remove 1 of player's tool from player
set {_cucc33} to random element out of {lada::*}
execute console command "/give %player% %{_cucc33}%"

What is my problem:
When I open the crate nothing happens.

When I open the console I see this:
[17:07:36] [Server thread/INFO]: CONSOLE issued server command: /give noob123
[17:07:36] [Server thread/INFO]: Hiba: Ismeretlen tárgy név: .

Server version: spigot 1.8.8
Skript plugins: Skript 2.2, skript-mirror, skUtilities, SkQuery, TuSKe, SkQuery
 
Im trying to make a crate opening skript.
The code:
options:
{lada:1} = 322 8
{lada:2} = 373:8201
{lada:3} = 322:1
{lada:4} = 332 12

on right click with 131:
if clicked block is end portal frame:
cancel event
remove 1 of player's tool from player
set {_cucc33} to random element out of {lada::*}
execute console command "/give %player% %{_cucc33}%"

What is my problem:
When I open the crate nothing happens.

When I open the console I see this:
[17:07:36] [Server thread/INFO]: CONSOLE issued server command: /give noob123
[17:07:36] [Server thread/INFO]: Hiba: Ismeretlen tárgy név: .

Server version: spigot 1.8.8
Skript plugins: Skript 2.2, skript-mirror, skUtilities, SkQuery, TuSKe, SkQuery
You may want to register your variables with "variables:" not "options:" and you should stop using id based item. (+ you can actually give item with Skript so I replaced the /give line)
Here is the fixed code:
Code:
variables:
    {lada::1} = 8 Golden Apple
    {lada::2} = Potion of Strength
    {lada::3} = Enchanted Golden Apple
    {lada::4} = 12 Snowball

on rightclick:
    player's tool is Tripwire Hook
    clicked block is End Portal Frame
    cancel event
    remove 1 Tripwire Hook from player
    set {_cucc33} to random element out of {lada::*}
    give {_cucc33} to player
 
It is using execute console command for a reason...

You can't really do this with skript's give mechanic:
{lada::5} = 425:14 1 fortune:10 name:&8»_&d&lJobb_Klikk!_&8« lore:_&8»_&7Kit_lehívás|_&8»_&6&lVenom itemflags:HIDE_ATTRIBUTES,HIDE_ENCHANTS