#is there any way to simpifly this

1 messages · Page 1 of 1 (latest)

spark maple
#

hi

#
    if event-entity is a zombie or skeleton:
        set {_loot1} to a random integer between 1 and 1000
        if {_loot1} < 25 then:
            equip event-entity with netherite helmet
        else if {_loot1} < 100 then:
            equip event-entity with diamond helmet
        else if {_loot1} < 200 then:
            equip event-enttiy with iron helmet
        else if {_loot1} < 400 then:
            equip event-entity with gold helmet
        else if {_loot1} < 500 then:
            equip event-entity with chainmail helmet
        else if {_loot1} < 700 then:
            equip event-entity with copper helmet
        else if {_loot1} < 900 then:
            equip event-entity with leather helmet
        else if {_loot1} < 1000 then:
            #do nothing
        set {_loot2} to a random integer between 1 and 1000
        if {_loot2} < 25 then:
            equip event-entity with netherite chestplate
        else if {_loot2} < 100 then:
            equip event-entity with diamond chestplate
        else if {_loot2} < 200 then:
            equip event-enttiy with iron chestplate
        else if {_loot2} < 400 then:
            equip event-entity with gold chestplate
        else if {_loot2} < 500 then:
            equip event-entity with chainmail chestplate
        else if {_loot2} < 700 then:
            equip event-entity with copper chestplate
        else if {_loot2} < 900 then:
            equip event-entity with leather chestplate
        else if {_loot2} < 1000 then:
            #do nothing```
#
        if {_loot3} < 25 then:
            equip event-entity with netherite leggings
        else if {_loot3} < 100 then:
            equip event-entity with diamond leggings
        else if {_loot3} < 200 then:
            equip event-enttiy with iron leggings
        else if {_loot3} < 400 then:
            equip event-entity with gold leggings
        else if {_loot3} < 500 then:
            equip event-entity with chainmail leggings
        else if {_loot3} < 700 then:
            equip event-entity with copper leggings
        else if {_loot3} < 900 then:
            equip event-entity with leather leggings
        else if {_loot3} < 1000 then:
            #do nothing        
        set {_loot4} to a random integer between 1 and 1000
        if {_loot4} < 25 then:
            equip event-entity with netherite boots
        else if {_loot4} < 100 then:
            equip event-entity with diamond boots
        else if {_loot4} < 200 then:
            equip event-enttiy with iron boots
        else if {_loot4} < 400 then:
            equip event-entity with gold boots
        else if {_loot4} < 500 then:
            equip event-entity with chainmail boots
        else if {_loot4} < 700 then:
            equip event-entity with copper boots
        else if {_loot4} < 900 then:
            equip event-entity with leather boots
        else if {_loot4} < 1000 then:
            #do nothing```
reef moth
#

I dont think I've ever seen if %condition% THEN: before

#

also #do nothing will give an empy configuration section warning. You can just remove those if statements, or use stop/continue

spark maple
#

cuz im a roblox developer

spark maple
reef moth
#

I mean you are basically doing the same thing over and over again

#

so ig you could use a function; blah blah: giveRandomHelmet(player) ... giveRandomBoots(player)

spark maple
#
    if event-entity is a zombie or skeleton:
        set {_loot1} to a random integer between 1 and 1000
        set {_loot2} to a random integer between 1 and 1000
        set {_loot3} to a random integer between 1 and 1000
        set {_loot4} to a random integer between 1 and 1000
        if {_loot1} < 25:
            equip event-entity with netherite helmet
        else if {_loot1} < 100:
            equip event-entity with diamond helmet
        else if {_loot1} < 200:
            equip event-entity with iron helmet
        else if {_loot1} < 400:
            equip event-entity with golden helmet
        else if {_loot1} < 500:
            equip event-entity with chainmail helmet
        else if {_loot1} < 700:
            equip event-entity with copper helmet
        else if {_loot1} < 900:
            equip event-entity with leather helmet
        else if {_loot1} < 1000:
            stop
        if {_loot2} < 25:
            equip event-entity with netherite chestplate
        else if {_loot2} < 100:
            equip event-entity with diamond chestplate
        else if {_loot2} < 200:
            equip event-entity with iron chestplate
        else if {_loot2} < 400:
            equip event-entity with golden chestplate
        else if {_loot2} < 500:
            equip event-entity with chainmail chestplate
        else if {_loot2} < 700:
            equip event-entity with copper chestplate
        else if {_loot2} < 900:
            equip event-entity with leather chestplate
        else if {_loot2} < 1000:
            stop```
#
            equip event-entity with netherite leggings
        else if {_loot3} < 100:
            equip event-entity with diamond leggings
        else if {_loot3} < 200:
            equip event-entity with iron leggings
        else if {_loot3} < 400:
            equip event-entity with golden leggings
        else if {_loot3} < 500:
            equip event-entity with chainmail leggings
        else if {_loot3} < 700:
            equip event-entity with copper leggings
        else if {_loot3} < 900:
            equip event-entity with leather leggings
        else if {_loot3} < 1000:
            stop
        if {_loot4} < 25:
            equip event-entity with netherite boots
        else if {_loot4} < 100:
            equip event-entity with diamond boots
        else if {_loot4} < 200:
            equip event-entity with iron boots
        else if {_loot4} < 400:
            equip event-entity with golden boots
        else if {_loot4} < 500:
            equip event-entity with chainmail boots
        else if {_loot4} < 700:
            equip event-entity with copper boots
        else if {_loot4} < 900:
            equip event-entity with leather boots
        else if {_loot4} < 1000:
            stop```
#

i had to update the code because there were a lot of typos but why is this happening?

#

bruh how does this happen

spark maple
#

i notice its only with copper armor

#

x8ight

#

help

#

also nothing even happens for skeletons

reef moth
#

set their boots

#

/helemt/etc

spark maple
#

thats not helpful

#

why does copper armor appear in the wrong places

#

and why do skeletons have no armor

spark maple
finite crane
# spark maple also its only copper armor no other armor is appearing in different places
neon plover
#

If you want randomness creating a list of the different items then choosing a random item from the list seems way simpler

#

And if u want to increase the chance of any specific item just add it to the list multiple times

neon plover
#

U just gotta wait for an update

#

Prolly cause copper armor just got added

spark maple
spark maple
#

wait how do i even create a list

inner hornetBOT
spark maple
#

oh ok

#

why cant he speak to me himself?

neon plover
#

Then u can just do equip event-entity with random element of {list::*}

neon plover
spark maple
#

i thought u told someone to tell me that

neon plover
#

lol

#

Wait if ur just doing all armor I’m pretty sure u could use tags

#

I’m not on my pc rn but once I am I’ll look at skript docs and send u the stuff u need to do this with tags

neon plover
#

Excluding the spawn event & checking if it’s a zombie

#

So like 6 lines total

#

Actually mabye a bit more cause u want a chance of it being no armor

#

But still way shorter than a list or what ur doing rn

spark maple
neon plover
#
#

this is what u will need ^

#

tell me if u need help understanding what to do

spark maple
#

im using minecraft tag right?

neon plover
#

i think the syntax is something like random element of minecraft tag "helmets"

spark maple
#

so
equip event-entity with a random element of minecraft tag "helmets"

neon plover
#

yeah as I said its something like that

#

not exactly that

spark maple
spark maple
#

@neon plover

#

how do i figure out what the syntax is

reef moth
#

The docs

spark maple
neon plover
spark maple
#

how do i broadcast a list

#

how do i parse them as item types

#

oh wait

#

it just prints none

#
    if event-entity is a zombie or skeleton:
        unequip event-entity's armor
        broadcast "%minecraft tag "helmets"%"
        equip event-entity with a random element of minecraft tag "helmets"
        equip event-entity with a random element of minecraft tag "chestplate"
        equip event-entity with a random element of minecraft tag "leggings"
        equip event-entity with a random element of minecraft tag "boots"```
#
    if event-entity is a zombie or skeleton:
        unequip event-entity's armor
        broadcast "%random element of minecraft tag "helmets"%"
        equip event-entity with a random element of minecraft tag "helmets"
        equip event-entity with a random element of minecraft tag "chestplate"
        equip event-entity with a random element of minecraft tag "leggings"
        equip event-entity with a random element of minecraft tag "boots"```
doing this also just says none
heady cradle
spark maple
heady cradle
#

you forgot the "

spark maple
#

it just prints this

#

broadcast "%minecraft tag "head_armor"%"

#

and prints the same for

#

broadcast "%random element of minecraft tag "head_armor"%"

#

this ^

spark maple
#

so i tired to do lists instead but it wont work

#

set {_helmets::*} to "netherite helmet", "diamond helmet", "iron helmet", "golden helmet", and "leather helmet"

#

bruh this thing is wrong

#

i tired like several different possibilities

#

i dont think lists are a thing

neon plover
spark maple
#

how do i do that

#

show me

neon plover
#
spark maple
#

no i know what a oxford comma is

#

but already tired to remove it

#

and it dindt work

neon plover
#

works for me

#

unless by "does not work" you mean something other than its throwing an error

spark maple
#

i meant throwing errors

spark maple
# neon plover unless by "does not work" you mean something other than its throwing an error

so like this set {_helmets::*} to "netherite helmet", "diamond helmet", "iron helmet", "golden helmet" and "leather helmet" set {_chestplates::*} to "netherite chestplate", "diamond chestplate", "iron chestplate" "golden chestplate" and "leather chestplate" set {_leggings::*} to "netherite leggings", "diamond leggings", "iron leggings", "golden leggings" and "leather leggings" set {_boots::*} to "netherite boots", "diamond boots", "iron boots", "golden boots" and "leather boots"

reef moth
#

nooo

#

why are they strings too

spark maple
#

i will remove

#

if it doesnt work

spark maple
spark maple
#

should i just remove all commas?

#

bro it errors

#

it doesnt work

#

i removed the oxford comma

reef moth
#

pretty sure you need to combine these

spark maple
#

how is that suppose to help me bru

#

i need to fix my lists

#

somehow

reef moth
#

thats how you turn minercfta tag "helmets" into leather helmet, gold helmet, chain helemet,..., diamond helmet, netherite helmet

spark maple
#

also i gave up on that i just wanna make my own lists

reef moth
#

You get the value of the helmwt tag i think

spark maple
spark maple
#

i finally got it to work it just needed a function

    set {_helmets::*} to netherite helmet, diamond helmet, iron helmet, golden helmet and leather helmet
    set {_chestplates::*} to netherite chestplate, diamond chestplate, iron chestplate, golden chestplate and leather chestplate
    set {_leggings::*} to netherite leggings, diamond leggings, iron leggings, golden leggings    and leather leggings
    set {_boots::*} to netherite boots, diamond boots, iron boots, golden boots and leather boots
on spawn:
    if event-entity is a zombie or skeleton:
        unequip event-entity's armor
        equip event-entity with a random element of {_helmets::*}
        equip event-entity with a random element of {_chestplates::*}
        equip event-entity with a random element of {_leggings::*}
        equip event-entity with a random element of {_boots::*}```
#

but skeletons still dont have any armor

#
    set {helmets::*} to netherite helmet, diamond helmet, iron helmet, chainmail helmet, golden helmet and leather helmet
    set {chestplates::*} to netherite chestplate, diamond chestplate, iron chestplate, chainmail chestplate, golden chestplate and leather chestplate
    set {leggings::*} to netherite leggings, diamond leggings, iron leggings, chainmail leggings, golden leggings and leather leggings
    set {boots::*} to netherite boots, diamond boots, iron boots, chainmail boots, golden boots and leather boots
on spawn:
    if event-entity is a zombie or skeleton:
        unequip event-entity's armor
        equip event-entity with a random element of {helmets::*}
        equip event-entity with a random element of {chestplates::*}
        equip event-entity with a random element of {leggings::*}
        equip event-entity with a random element of {boots::*}```
reef moth
#

There shouldnt be an event-entity on the load event

spark maple
heady cradle
spark maple
spark maple
heady cradle
#

probably same but

#

body
leg
foot

spark maple
#

no
equip event-entity with a random element of tag values of minecraft tag "body_armor"
doesnt work

#

theres no errors

#

oh

#
        equip event-entity with a random element of tag values of minecraft tag "chest_armor"
        equip event-entity with a random element of tag values of minecraft tag "leg_armor"
        equip event-entity with a random element of tag values of minecraft tag "foot_armor"```
spark maple
#

look at this xd

#

server didn't surrive