How to get a number started by a

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

FabricioSouza

Well-Known Member
Mar 15, 2018
267
3
0
25
I want to make a way to get a number started by 1. For example: set {_n} for% integer%. This integer will get a number started by 1.
 
code_language.skript:
set {_n} to "1%random number between 0 and 100%" parsed as a number
 
code_language.skript:
command /up1:
    trigger:
        if {var::Name} isn't set:
            set {var::Name} to 0
        else:
            add 1 to {var::Name}
        send "The new value is %{var::Name}%"
 
THANK YOU ALL. Maseu wanted it another way.

For example: {ID.% Integer%}, will generate a number with # that means the id and% integer% will get 1st number. That will be one.

For example: set {_n} for% {ID.% Integer%}%. Since the number of {ID.% Integer%} will start with one.

How do I set {_n} to% {ID.% Integer%}% will start from 1. So if I set anything else it will be 2 because number 1 has been set to {_n} and so on.
[doublepost=1525178911,1525178854][/doublepost]Guys, I'm not refusing your help, but I was wondering if you can do this any way.
[doublepost=1525182572][/doublepost]I was decompiling a plugin and found this, what it does.

HERE IS WHAT I FIND: BanInfo info = (BanInfo) banInfo.get (Integer.valueOf (i));
[doublepost=1525182605][/doublepost]int id = Integer.parseInt(args[1]) - 1;
String victim = args[0];
if (((id < 0 ? 1 : 0) | (id > this.db.getBanInfo(victim).size() ? 1 : 0)) != 0)
 
You’ve asked this same question about ban id’s 3 times now and you keep telling us we’re all doing it wrong.
Create one thread and stick with it
 
You’ve asked this same question about ban id’s 3 times now and you keep telling us we’re all doing it wrong.
Create one thread and stick with it

My friend, if you have any problems, I mentioned the BAN ID business here if you saw me speak here. I did not say then ready. Oxi, but it's each.
 
https://forums.skunity.com/threads/punishment-id-system.7074/
and
https://forums.skunity.com/threads/how-to-make-an-id-system-with-punishment.7024/

This is now your third thread regarding a ban/punishment ID system.
Please just make 1 thread and stick with it, rather than asking the SAME question in a different format.

SEVERAL people have offered help on this topic, and each time you refuse their help, and change what you want.

I do not refuse your help, but it's because it will not do what I want. Because if all the codes and help sent by you had what I wanted completely I would thank you very much.
 
Again, stick with 1 thread rather than creating multiple threads.
Plenty of people here have attempted to help you, and some how, not even the smartest Skripters like Donut and LimeGlass have been able to help you, and have given up helping you.

Whether it be the language barrier, the translator you are using, or you not knowing how to get your point across, it seems we are all at a loss for helping you.

Ill say it one last time, create ONE thread, and use that, rather than constantly posting new threads for the same issue.
 
Again, stick with 1 thread rather than creating multiple threads.
Plenty of people here have attempted to help you, and some how, not even the smartest Skripters like Donut and LimeGlass have been able to help you, and have given up helping you.

Whether it be the language barrier, the translator you are using, or you not knowing how to get your point across, it seems we are all at a loss for helping you.

Ill say it one last time, create ONE thread, and use that, rather than constantly posting new threads for the same issue.




Okay, I beg your pardon.
[doublepost=1525190812,1525188306][/doublepost]
Again, stick with 1 thread rather than creating multiple threads.
Plenty of people here have attempted to help you, and some how, not even the smartest Skripters like Donut and LimeGlass have been able to help you, and have given up helping you.

Whether it be the language barrier, the translator you are using, or you not knowing how to get your point across, it seems we are all at a loss for helping you.

Ill say it one last time, create ONE thread, and use that, rather than constantly posting new threads for the same issue.

ShaneBee, I'll create a topic in Addon Tips, to create an addon that would be cool for Skript.
 
I wanted it to look like this: I got the number 1 because the list {list :: numbers} starts with one, I do not want to get a random number but started by a then ai by 2 and so on.
 
Yes for the 10th time. I have already showed you how to do this when you asked the first time in one of your 5 threads regarding punishment id’s
If you go back to your first post regarding punishment id’s you will see my answer there that I spoon fed how to do this
 
Yes for the 10th time. I have already showed you how to do this when you asked the first time in one of your 5 threads regarding punishment id’s
If you go back to your first post regarding punishment id’s you will see my answer there that I spoon fed how to do this

But, I do not want to be adding, but to get a number that I do not add.
 
so you want a number to increase by 1 each time you use it, but you do not want to add 1 to the number?
You just want the number to magically increase by 1 without you having to do anything?

What the heck?

I also find it funny that you have offered your "help" on other peoples skript help when you cant event figure out this most basic of basic things.
 
so you want a number to increase by 1 each time you use it, but you do not want to add 1 to the number?
You just want the number to magically increase by 1 without you having to do anything?

What the heck?

I also find it funny that you have offered your "help" on other peoples skript help when you cant event figure out this most basic of basic things.

See I had done this here in my code: set {BAN.ID.% player%} to 1. Here when I put the message appeared: Your id is {BAN.ID.% player%} and if it is for another player it will have one or two.
 
YES, and like I said before, you need to set a separate variable for just counting up the numbers. You would set that to 0 and then each time you banned someone add 1 to that variable and then assign that variable/number to the player
 
My code looks like this: set {ban.id.% player%} to 1 as I set it to one, every time I run the command it will set to two or one because I did this and it did not set to two.
 
That is because you clearly have no idea how to write skript

code_language.skript:
on load:
    if {ban.id} is not set:
        set {ban.id} to 0       #this is there to originally set the id number

command /ban <offline player> <text>:
    trigger:
        add 1 to {ban.id}                #this is to add 1 to the original ban id, and each time you ban someone it increases
        set {ban.id.%arg-1%} to {ban.id}   #This is to assign the specific ban id to the player you are banning
[doublepost=1525540347,1525540148][/doublepost]so in this case, you will see that on the very first start up of the skript, it sets the universal ban ID to 0
When you ban your first player it will add 1 to that number (0) which will now make that number 1, and then assign that ID (1) to the player you banned, so now they have ban ID 1

The next time you run the command, it will add 1 to that universal ID (1) now making it 2
And then it will assign that ID (2) to the player, so the player will have ban id 2

The next time you run the command, it will add 1 to that universal ID (2) now making it 3
And then it will assign that ID (3) to the player, so the player will have ban id 3
 
Status
Not open for further replies.