Solved Get the player to send a random variable

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

rwdish

New Member
May 8, 2022
8
0
1
19
Hello! Today i wanted to add a sort of registration number to use on guns on my roleplay server.
I thought of something like this:

command /matricola:
trigger:
set {_random} to a random integer between 1 and 999
make player execute command "/setlore &7Matricola: &a{_random}"

Allthough it doesn't work, maybe i just need to find a line of code that sets the lore without a command, so i came over for help here.
upload_2022-5-8_11-14-4.png


(Plugin used for /setlore is SimpleRename)
Doesn't render spaces for some reason, you get the point hopefully.
 
You are not putting % symbols around the variable, so the skript thinks its just another text. Instead, use this:
Code:
"/setlore &7Matricola: &a%{_random}%"
However, this might result in some items (or in your case guns) having the same "id" so instead you might want to make a global variable and such as {gunID} and whenever you create a new gun, you add 1 to the variable and then set the lore to that, so that they will all have unique ID's
 
Status
Not open for further replies.