putting variable values into item names

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

    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!

DPPPPP

Member
Jul 22, 2023
27
0
1
all i need is for the stone to drop a button with a name of a random integer between 50 and 2000 and if you guys could put text in there that says something like Age: (number) or even if it is possible to just add this number to the lore (I have tried with basically the same code.
This is what i have.

CODE:


on break of stone:
set {_r1} to 1 stone button
set {_age1} to random integer between 50 and 2000
cancel drops
set name of {_r1} to {_age1}
drop {_r1}
 
Code:
on break of stone:
   cancel drops
   set {_r1} to stone button
   set {_age1} to random integer between 50 and 2000
   cancel drops
   set name of {_r1} to "&b%{_age1}%"
   drop 1 of {_r1} at event-block's location
It looks like you had a couple issues with your code. One of the main issues was setting the item's name. An item name is typically stored in a text meaning you couldn't set an items name directly to a variable. Another smaller issue was you just put "drop {_r1}" and didn't specify where or the quantity; both of which are needed for that expression.