#How do I identify a property and its numbering with the script?

1 messages · Page 1 of 1 (latest)

royal kiln
#

wdym property?

ivory pulsar
royal kiln
#

scoreboard?

ivory pulsar
#

query.property('ssak:test') >= 4000

#

How do I identify this with script?

royal kiln
royal kiln
#

if the value of the property is string just change 2 with '<value>'

#

@ivory pulsar

ivory pulsar
#

I want to identify two and larger numbers

#
player.getProperty('<name>') >= 2```
#

?

royal kiln
ivory pulsar
#

Ok

#

Thanks you

#

@royal kiln

#

It's giving this error

royal kiln
ivory pulsar
# royal kiln can you send the part of the code?
const delay = 2, skillItem = "beyond:skill.1.1"

mc.world.afterEvents.itemStopUse.subscribe(event => {

  const player = event.source, item = event.itemStack, duration = event.useDuration
  if (item.typeId === skillItem && player.getProperty('ssak:test') >= 100) {
ivory pulsar
royal kiln
#

wait did you activate experimental?

ivory pulsar
#

That's why I didn't send it

royal kiln
#

okay wait

royal kiln
ivory pulsar
# royal kiln just send this whole ```mc.world.afterEvents.itemStopUse.subscribe```
const delay = 2, skillItem = "beyond:skill.1.1"

mc.world.afterEvents.itemStopUse.subscribe(event => {

  const player = event.source, item = event.itemStack, duration = event.useDuration
  if (item.typeId === skillItem && skill.getProperty('lian:maestry') >= 100) {

    libBefore.conditionSkill(player, 10, 2, (player) => {  libBefore.delayItem(player, skillItem, player.selectedSlot, delay)

      const skill = player.dimension.spawnEntity("beyond:skills.1.1", new Vector3(lib.actions.getFront(player, 3).x, player.location.y, lib.actions.getFront(player, 3).z))
      skill.setProperty("beyond:y", player.getRotation().y)
      skill.nameTag = player.nameTag
      player.playAnimation("animation.player.skills.1.1.1")
      mc.world.playSound("skill.1.1.1", skill.location, {volume: 5, pitch: lib.calculate.random(8, 12) / 10}) // sound
      const targets = skill.dimension.getEntities({location: skill.location, maxDistance: 2, excludeNames: [skill.nameTag], excludeFamilies: ["not"]})
      
      lib.animate({
        
        player: player,
        loop: false,
        timeline: [
          
          [0.4, function(player) {
            
            targets.forEach(target => {
            
              target.applyDamage(1, {cause: "contact", source: player})
              damageEffect(target)
              target.applyKnockback(player.getViewDirection().x, player.getViewDirection().z, 10, 5)
              target.setProperty("lian:floor", 0)
  
  
            })
            skill.dimension.spawnParticle("beyond:skills.1.1.1", new Vector3(skill.location.x, skill.location.y + 1.2, skill.location.z))
    
    
          }],
          [0.5, function(player) {
            
            skill.remove()
    
    
          }]
      
        ]
      
      
      })


    })
      


  }


})
ivory pulsar
ivory pulsar
#

I don't understand, how could this be interfering?

royal kiln
royal kiln
ivory pulsar
#

I'll try

royal kiln
ivory pulsar
royal kiln
royal kiln
ivory pulsar
#

I wanted to set the property according to the property present in the player

royal kiln
#

did you add proerty on the player.json?

ivory pulsar
#

Look

#
        "lian:maestry": {"client_sync": true, "type": "int", "default": 0, "range": [0, 999]},
#

In the script, I put

player.getProperty('lian:maestry') >= 100
royal kiln
ivory pulsar
royal kiln
royal kiln
ivory pulsar
#

I want it to detect the property present in the player

royal kiln
ivory pulsar
#

Doesn't seem to be detecting

#

This error keeps appearing non-stop

royal kiln
#

remove that part then re;lload and check if the error keeps persisting

royal kiln
ivory pulsar
#

Which in this case is this

function mastery(player) {

  player.setProperty("lian:maestry", `${player.getDynamicProperty("mastery")}`)


}
royal kiln
royal kiln
ivory pulsar
royal kiln
ivory pulsar
#

I want that script to work only when the property is 100 or greater than 100, but it is not working

royal kiln
#

cause the error saying the values your setting on you player proerty is not valid

royal kiln
ivory pulsar
ivory pulsar
royal kiln
#

whats the values of the dynamic proerty?

ivory pulsar
royal kiln
#

it stops the mc.world.afterEvents.itemStopUse.subscribe when it meets the property

#

sorry if i suck at english

ivory pulsar
ivory pulsar
#

This is no different

royal kiln
#

I want this script to work only if I have the "lian:maestry" property at 100 or greater than 100

ivory pulsar
#
const delay = 2, skillItem = "beyond:skill.1.1"

mc.world.afterEvents.itemStopUse.subscribe(event => {

  const player = event.source, item = event.itemStack, duration = event.useDuration
  if (item.typeId === skillItem && player.getProperty('lian:maestry') >= 100) {
#

It will keep giving the same error

ivory pulsar
royal kiln
royal kiln
ivory pulsar
royal kiln
#

check if the error still persists

#

lets experiment @ivory pulsar

ivory pulsar
#

Ok

#

@royal kiln

#

Started working again

royal kiln
#

do js player.sendMessage(`${player.getDynamicProperty("mastery")}`);

#

we need to check the values

ivory pulsar
#

Ok

#

@royal kiln

royal kiln
#

what's the values?

ivory pulsar
#

These messages are appearing

royal kiln
#

see

#

the dybnamic proerty is not valid

ivory pulsar
royal kiln
#

what supposed to be the values there? @ivory pulsar

ivory pulsar
#

This property is set during the game

#

This is like a level

royal kiln
#

player level or custom level?

ivory pulsar
#

In theory, when I put player.getProperty in the script, it would identify the property present in the player entity

#

BUT THAT'S NOT WHAT'S HAPPENING

#

We have been talking for a long time about an error that is preventing the identification of this property

royal kiln
ivory pulsar
royal kiln
ivory pulsar
#

The dynamic property works like a level counter, like a scoreboard

royal kiln
#
const mastery = world.scoreboard.getObjective('mastery').getScore(player);
player.setDynamicProperty('mastery', `${mastery}`);

like this @ivory pulsar ?! This will get your score on the objective mastery then put those values inside of dynamic property.

royal kiln
#

imma go now.... just ping me if you every need help dude...

ivory pulsar
#

I can't make you understand what the problem is

#

It is difficult for us to communicate because of the translator

royal kiln
#

there's a bot

ivory pulsar
#

@royal kiln

grizzled pastureBOT
#
coddy2009

qual é o problema @ivory pulsar?

ivory pulsar
#

Instead of trying to detect the player property, I made it identify the dynamic property

#
 && player.getDynamicProperty("mastery") >= 100
grizzled pastureBOT
#
coddy2009

Então, como você definiria os valores da propriedade dinâmica?

ivory pulsar
grizzled pastureBOT
#
coddy2009

obter os valores da propriedade e defini-la como propriedade dinâmica?

ivory pulsar
#

I'll try to be direct

#

The property present in the player entity is defined depending on the dynamicproperty

royal kiln
ivory pulsar
#

Entity values ​​are set according to the dynamic property

royal kiln
ivory pulsar
#

To clarify your doubt, I say that the values ​​of the dynamic property are added by mathematics

royal kiln
#

okay i get it ow, good luck with it....