Create each holo object with random ID

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

Status
Not open for further replies.

maleev

Member
Apr 25, 2020
1
0
0
Hello, I need to create multiply holograms each of it need to be with random ID and can be deleted.
Thank you.

I have some code, but when two players creating holos they are have a same ID.

Code:
command /doholo [<player>]:
    trigger: 
        if {avalible} is true:                       
            set {id::*} to "A", "E", "Z", "O", "F", "P" and "L"
            set {id1::*} to "A", "E", "Z", "O", "F", "P" and "L"
            set {id2::*} to "A", "E", "Z", "O", "F", "P" and "L"
            set {_gen} to random element out of {id::*}
            set {_gen1} to random element out of {id1::*}
            set {_gen2} to random element out of {id2::*}
            set {finalgen} to "%{_gen}%%{_gen1}%%{_gen2}%"
            delete {id::*}
            delete {id1::*}
            delete {id2::*}   
            create interactive client side holo object "&cЗакладка;ItemStack:Ghast_Tear;" with id "klad.%{finalgen}%" at location of player to arg-1
            set {finaltarget} to "final.%{finalgen}%"
            set {avalible} to false
        else:
            broadcast "no"

              
on hologram touch:
    if event-string is {finaltarget}:
        set {avalible} to true   
        give player ghast tear named "&b&lTest" with lore "&8Test."
        delete holo object {finaltarget}
    else:
        broadcast "ERROR"
 
Status
Not open for further replies.