Why is this function now working

  • Welcome to skUnity!

    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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Brandawg

Member
May 8, 2017
19
0
1
23
So it says that levelUp(p: player) is not a text but I have this isn't it right
code_language.skript:
function levelUp(p: player):
    if {xp::_p} >= {xpRequired::_p}:
        set {xp::_p} to 0
        add 1 to {level::_p}
        add 1 to {_p}'s level
        set {xpRequired::_p} to ({xpRequired::_p} * 1.15)
 
Because the player in the function does not exist in the lines. You need to do %{_p}% instead of _p to get the code to work.
 
Because the player in the function does not exist in the lines. You need to do %{_p}% instead of _p to get the code to work.
still get levelUp(player) is not a text
code_language.skript:
function levelUp(player):
    if %{xp::_p}% >= %{xpRequired::_p}%:
        set %{xp::_p}% to 0
        add 1 to %{level::_p}%
        add 1 to %{_p}%'s level
        set {%xpRequired::_p}% to %({xpRequired::_p}% * 1.15)
        return:
 
still get levelUp(player) is not a text
code_language.skript:
function levelUp(player):
    if %{xp::_p}% >= %{xpRequired::_p}%:
        set %{xp::_p}% to 0
        add 1 to %{level::_p}%
        add 1 to %{_p}%'s level
        set {%xpRequired::_p}% to %({xpRequired::_p}% * 1.15)
        return:

No no no... under the function, not next the function line. Undo what you did in that code and do it in your previous one. Then do this,
code_language.skript:
set {xp::%{_p}%} to 0
 
No no no... under the function, not next the function line. Undo what you did in that code and do it in your previous one. Then do this,
code_language.skript:
set {xp::%{_p}%} to 0
still does not work I am just going to use a loop but while I have you here is there a way so that I can clear all of the players xp so it is not full I have tried this but says I can only do it during a fishing event remove all xp from players
 
still does not work I am just going to use a loop but while I have you here is there a way so that I can clear all of the players xp so it is not full I have tried this but says I can only do it during a fishing event remove all xp from players
How does it not work? You're doing something wrong which is pretty easy to fix.
 
Status
Not open for further replies.