#(JeanMarie) need help with 'after player kills ...'

60 messages · Page 1 of 1 (latest)

edgy stag
#

Hello,
Is it possible to replace in the following script part:
need help with 'after player kills pig flagged:npc_kill_quest_mobs_count:'
When the quest is offered to the player, the animal to be killed is chosen randomly among several animals
https://paste.denizenscript.com/View/102814
And so I would like to replace
pig by npc_kill_quest_mob_select
If yes, how?

sullen parcelBOT
#

(JeanMarie) need help with 'after player kills ...'

sullen parcelBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>

rocky zodiac
#

what?

#

!vague

rustic juniperBOT
# rocky zodiac !vague
Info: vague

Your question is too vague to be able to answer well.

If you're asking how to do something, please make sure to add some background detail. Make sure to specify your overall end goal and the general design/idea and any existing progress towards that goal, not just the single specific point.

For script-related problems, see also !info haste debug. For non-scripting server trouble, see !logs.

See also !xyproblem

edgy stag
#

I edited the post****

rocky zodiac
#

so, you want to spawn the entity that's stored in the npc_kill_quest_mob_select flag?

#

e.g.: if its "pig", spawns a pig, if its "zombie", spawns a zombie

edgy stag
#

what I want is for the event to react according to the animal selected in my flag
sorry I just saw that I deleted this part of code. I edit my first message

rocky zodiac
#

!rule 8

rustic juniperBOT
# rocky zodiac !rule 8
Rule 8

Don't overuse the edit/delete buttons. https://denizenscript.com/discord_rules#rule8
Use the edit button to fix typos, and the delete button to remove an accidental post shortly after posting.
Do not remove a post that pings someone, do not edit or delete a post that people have already replied to.

rocky zodiac
#
  • just use more than one event, bruh
#

after player kills pig flagged:npc_kill_quest_mobs_count
after player kills zombie flagged:npc_kill_quest_mobs_count
after player kills skeleton flagged:npc_kill_quest_mobs_count

#

then you just gotta check if the value of the flag is the same as the mob in the event

#

so, example:

after player kills pig flagged:npc_kill_quest_mobs_count:
  - if <player.flag[npc_kill_quest_mobs_count]> == pig:
    - do stuff
edgy stag
#

I suspected a little
then a small question again would it be possible to add several flags to the event?
flaged:npc_kill_quest_mobs_count:...
This would be a way to activate only the event having all the set flags
Sorry if my english is not very clear

rocky zodiac
edgy stag
#

how would you put that in this example?
after the player kills a pig marked :npc_kill_quest_mobs_count:
assuming that the other flag would be
npc_kill_quest_mob_select
Thank you again for your help

rocky zodiac
#

you just switch the names from the template i gave you

#

instead of flag1|flag2|flag3, you use your actual flag names

edgy stag
#

Thanks again. Sorry I'm not very good at English.
the vertical bar | doesn't she mean or?

rocky zodiac
#

|| is or, | separates list values

edgy stag
#

ok 🙂 thank you

#

I will look tomorrow
Have a good day

rocky zodiac
#

you too! :>

gusty nest
#

wouldnt it be better to do

  - if <player.flag[npc_kill_quest_mobs_count].equals[<context.entity.name>]>:
    - do stuff```
#

surely

#

(idk if that context tag is correct but the vague idea anyway)

#

ehh maybe not no im wrong ^^

rocky zodiac
#

no, because the flag values are pig, zombie, skeleton, etc

#

not actual entitytags

gusty nest
#

adding that then

rocky zodiac
#

🫠

#

i mean if he wants to, lmao

gusty nest
#

but anyway i realised that firing it for entities that arent even a possibility is probably worse than the multiple events

#

cus of how ive been told denizen works

rocky zodiac
#

yeah prob, i generally prefer to go with the more "readable" way lmao

civic wave
#

post your full script please

rustic juniperBOT
civic wave
#

!t entity.entity_type

rustic juniperBOT
edgy stag
#

Thank you for all your answers.
I did it this way, when do you think?

#

Knowing that only the flag corresponding to the animal that the player must kill is created, the others are not.

rocky zodiac
#

ya seems alright

edgy stag
#

it works, it's just i wouldn't like it to consume too much tik