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 comminuty!
Now, what are you waiting for? Join the community now!
You can always check out skUnity Downloads for downloads and any other information about Skript!
Is there a way to increase or decrease the fullness of the exp bar? I want only the bar to change and move, not the player's level."
on level change:
set player's level to {%loop-player%.rpg.level}
thereCode:on level change: set player's level to {%loop-player%.rpg.level}
command /test:
trigger:
give 2 experience points to player #to fill the bar slightly
Instead of experience points, just use exp. For example:No, I didn't mean that. I want an effect that goes like:
Code:command /test: trigger: give 2 experience points to player #to fill the bar slightly
trigger:
give [number] exp to player
function exp(p: player):
set {_xp} to arg-1
give {_xp} exp to {_p}
command /give-exp <number>:
trigger:
exp(player)
Instead of experience points, just use exp. For example:
Code:trigger: give [number] exp to player
Here is a more complicated example:
Code:function exp(): set {_xp} to %arg-1% parsed as number give {_xp} exp to player command /give-exp <number>: trigger: exp()
Hope this helps!
This code is not tested.
How about using the word integer to describe arg-1 instead of number ?Wow, I didn't know I was this close. But now I have another question. When I give player 1 exp, it fills the bar more than I want. I tried to use 0.5 instead of 1 but it didn't work. Do you have any ideas?
So sorry to answer this late. I couldn't have a chance to write back. And no, unfortunately it doesn't work as well.How about using the word integer to describe arg-1 instead of number ?
Oh shoot, my complex example was wrong. Lmao. Let me edit my post rq.
Oof. Then try (1/2) . I'm pretty sure this should work. If not, then I might have another solution.So sorry to answer this late. I couldn't have a chance to write back. And no, unfortunately it doesn't work as well.
Oof. Then try (1/2) . I'm pretty sure this should work. If not, then I might have another solution.
command /give-exp:
trigger:
set {_xp} to 1/2
give {_xp} of exp to player
{_xp} of 1-experience orb can't be added to a player because the former is neither an item type, an inventory nor an experience point
I mean to put it in parenthesis-It doesn't work either. So far our code is:
Code:command /give-exp: trigger: set {_xp} to 1/2 give {_xp} of exp to player
And our error is:
Code:{_xp} of 1-experience orb can't be added to a player because the former is neither an item type, an inventory nor an experience point
Oh I'm sorry. But no this doesn't work. And I don't think the problem here is "(1/2)" because it also doesn't work when I put "1" instead of "(1/2)". And the error is:I mean to put it in parenthesis-
Try give {_xp} exp to player
And the 3rd line would look like this:
set {_xp} to (1/2)
'{_xp} exp' can't be added to a player because the former is neither an item type, an inventory nor an experience point
Hmm......Oh I'm sorry. But no this doesn't work. And I don't think the problem here is "(1/2)" because it also doesn't work when I put "1" instead of "(1/2)". And the error is:
Code:'{_xp} exp' can't be added to a player because the former is neither an item type, an inventory nor an experience point
function exp(n1: number, n2: number = 1) :: number:
return ({_n1} / {_n2})
give exp(1, 2) exp to player
I don't think it knows that it is a number. with the function, it's already parsed as a number so it should recognize it. Also, this code works with regular numbers too. For example:Oh I'm sorry. But no this doesn't work. And I don't think the problem here is "(1/2)" because it also doesn't work when I put "1" instead of "(1/2)". And the error is:
Code:'{_xp} exp' can't be added to a player because the former is neither an item type, an inventory nor an experience point
give exp(5) exp to player
You are trying to give a player half an experience point, you can’t. What you can do is:I don't think it knows that it is a number. with the function, it's already parsed as a number so it should recognize it. Also, this code works with regular numbers too. For example:
Code:give exp(5) exp to player
I don't have to fill out the second number because on default it's set to 1.
set level progress of player to 0.5
Couldn't you just add it instead of setting it?You are trying to give a player half an experience point, you can’t. What you can do is:
Code:set level progress of player to 0.5
You’re giving xp, im setting the level progressCouldn't you just add it instead of setting it?
You're setting the level progress; Not adding it.You’re giving xp, im setting the level progress
0.5 level progress is 50% of the xp bar
0.5 xp isn’t a thing
Which is what the OP asked forYou're setting the level progress; Not adding it.
No, they asked to give experience.Which is what the OP asked for
Which is what the OP asked for
No, they asked to give experience.