Solved CSGO Item scrolling

Discussion in 'Plugin Development' started by plasticono, Apr 19, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    plasticono

    I can't figure out how to make a scolling inventory for my kit pvp server I'm coming out with. I want to give a kit to a player with a certain chance when they open the crate. How would I make the items scroll? PLEASE HELP! :p
     
  2. Offline

    Zombie_Striker

    @plasticono
    1. Create a repeating task.
    2. After every __ ticks, move each itemstack over 1 slot. Add in a new item at the now empty slot in one of the corners.
    3. Stop the task after ___ times.
     
  3. Offline

    plasticono

    @Zombie_Striker Could you send me some code and one more question... How would I make it slowdown over time. Plus the rarity
     
  4. Offline

    Zombie_Striker

    @plasticono
    No one here will do your job for you. If you want someone to write the code for you, then make a PluginRequest thread.

    To make it slow down, get the Task instance and increase the delay.
     
  5. @plasticono zombie explained it pretty well already. You have to use some sort of seperate thread. For instance you could use the bukkit schedular for doing so. Then you generate a random amount of times the items shall move, for example 20 times. You also will need to set a sleep with every time you execute your task. Increase that sleep every time you changed the items. This will make the flow of the items look slower and slower. Finally after your task has ended just pick the item in the middle and you got your randomly generated drop.
    Also as zombie mentioned, dont forget to add a new item to the slot which becomes free every time you move the items and remove the item which would move outside the inventory.

    If you have any questions to the mentioned above, id reccomend searching the forum for a tutorial using bukkit schedulars, sleeps/cooldowns and/or generating random chances. stackoverflow.com is also a good resource.
     
  6. Offline

    plasticono

  7. Offline

    Zombie_Striker

    @plasticono
    Mark this thread as solved if your problem has been solved.
     
Thread Status:
Not open for further replies.

Share This Page