#How do I identify a property and its numbering with the script?
1 messages · Page 1 of 1 (latest)
Ye
scoreboard?
ahh ok
player.getProperty('<name>') === 2```
if the value of the property is string just change 2 with '<value>'
@ivory pulsar
yes, that's valid.
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) {
which is the line 53?
This is in another file
send the full script cause i'm not really sure which is the error cause the property is okay
wait did you activate experimental?
It's just that the script is really big
That's why I didn't send it
okay wait
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()
}]
]
})
})
}
})
okay wait.
@royal kiln
This is the error on line 1250
function mastery(player) {
player.setProperty("lian:maestry", player.getDynamicProperty("mastery"))
}
ohh i know why
I don't understand, how could this be interfering?
player.setProperty("lian:maestry", `${player.getDynamicProperty("mastery")}`)```
Should I replace?
yes replace the previous one with mine
I'll try
i wanna clarify if this is what you want.... you will set the property "lian:maestry" based on the value of the dynamic property "mastery"?
Now this appears
No
make sure the value of the dynamic proerty is valid to the values you put on player.json
then what you trying to do?
I wanted to set the property according to the property present in the player
did you add proerty on the player.json?
Yee
Look
"lian:maestry": {"client_sync": true, "type": "int", "default": 0, "range": [0, 999]},
In the script, I put
player.getProperty('lian:maestry') >= 100
what the values of the dynamic proerty?
playrr?
I wrote it wrong
is the values of the dynamic property in range of the properties you set?
@royal kiln
Look
does it detect the property?
I want it to detect the property
I want it to detect the property present in the player
that's what im asking does it detect it?
I don't know
Doesn't seem to be detecting
This error keeps appearing non-stop
remove that part then re;lload and check if the error keeps persisting
whats the line 1252 and 53
On line 53 there is the import of the function from line 1250
Which in this case is this
function mastery(player) {
player.setProperty("lian:maestry", `${player.getDynamicProperty("mastery")}`)
}
what this does is it's setting the playe property "lian:maestry" based on the values of player dynamic proerty "mastery"
that's why i asked if the values of dynamic property "mastery" is in range of the values valid in entity proerty
I understand, but how do I make that script identify too?
which values? property or dynamic proerty?
I want that script to work only when the property is 100 or greater than 100, but it is not working
cause the error saying the values your setting on you player proerty is not valid
function mastery(player) {
if (player.getProperty('lian:mastery') >= 100) {
player.setProperty("lian:maestry", `${player.getDynamicProperty("mastery")}`);
}
}```
But here are the values, how can it not be valid?
"lian:maestry": {"client_sync": true, "type": "int", "default": 0, "range": [0, 999]},
Nooo ðŸ˜ðŸ˜ðŸ˜ðŸ˜ðŸ˜
whats the values of the dynamic proerty?
I want this script to work only if I have the "lian:maestry" property at 100 or greater than 100
just add this
if (player.getProperty('lian:mastery') >= 100) return;
it stops the mc.world.afterEvents.itemStopUse.subscribe when it meets the property
sorry if i suck at english
I do not speak English too
But
This is no different
I want this script to work only if I have the "lian:maestry" property at 100 or greater than 100
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
yeah you could do that
But I want to resolve the error ðŸ˜ðŸ˜ðŸ˜ðŸ˜ðŸ˜
wait, whats the erro again?
this right>
do this inside of this function
function mastery(player) {
player.setProperty("lian:maestry", 1)
}```
check if the error still persists
lets experiment @ivory pulsar
see that's what i keep saying dude... the values you gonna set on the player proerty is out of range
do js player.sendMessage(`${player.getDynamicProperty("mastery")}`);
we need to check the values
what's the values?
These messages are appearing
I didn't understand
the dynamic proerty is undefined cause you did not set the values on it
what supposed to be the values there? @ivory pulsar
Friend
This property is set during the game
This is like a level
how'd you want the values of the dynamic property to be set?
player level or custom level?
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
just answer this....
I just used an easier way to explain
cause we're setting undefined to the entity property cause the the dynamic proerty mastery is not valid
The dynamic property works like a level counter, like a scoreboard
the values of the scoreboard goes to the dynamic proerty?
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.
No
then how?
imma go now.... just ping me if you every need help dude...
I'm trying to find the error
I can't make you understand what the problem is
It is difficult for us to communicate because of the translator
just translate it with /translate
there's a bot
@royal kiln
qual é o problema @ivory pulsar?
Instead of trying to detect the player property, I made it identify the dynamic property
&& player.getDynamicProperty("mastery") >= 100
Então, como você definiria os valores da propriedade dinâmica?
It doesn't matter, because the error isn't there
obter os valores da propriedade e defini-la como propriedade dinâmica?
I'll try to be direct
The property present in the player entity is defined depending on the dynamicproperty
so you're getting the values in the player property then set it to player's dynamic property?
It's the opposite
Entity values ​​are set according to the dynamic property
okay i get... but how would you set the values of the dynamic proerty? by what?
I read what you said
To clarify your doubt, I say that the values ​​of the dynamic property are added by mathematics
And the error is not here...
hmm kay
like random?
okay i get it ow, good luck with it....
