Solved function error idk why

  • 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 community!

    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.
Feb 24, 2017
191
7
0
foroendertheth.foroactivo.com
code_language.skript:
function name(p: player):
    wait a tick
    set the {_p}'s display name to "lol"
    #original# set the player's display name to "lol"
2018-05-01_17.46.41.png
 
Im terrible with functions but could you try putting % around the {_p}?
 
What is your code referencing the function?
[doublepost=1525212017,1525211852][/doublepost]try this
it loaded for me
code_language.skript:
function name(p: player):
    wait a tick
    set the display name of {_p} to "lol"
 
What is your code referencing the function?
code_language.skript:
on damage of a cave spider or spider:
    name(victim)
    chance of 15%:
        cancel event
        teleport the victim to the attacker
        message "{@logo}%victim% bloqueo tu ataque, se curo y se teleporto" to attacker
        add 3 to the victim's health
        set the name of the victim to "&c%health of victim%"
the problem is if I hit the victim the name if goin to be the max healt but if I wait a tick the name will be the life the mob have now. But if I put wait a tick the cancel event won't work. If I remove cancel event if the spider die and the chance of 15% active the spider will be all red and is just so hard to explain I just upload a photo
[doublepost=1525212309,1525212161][/doublepost]
code_language.skript:
on damage of a cave spider or spider:
    name(victim)
    chance of 15%:
        cancel event
        teleport the victim to the attacker
        message "{@logo}%victim% bloqueo tu ataque, se curo y se teleporto" to attacker
        add 3 to the victim's health
        set the name of the victim to "&c%health of victim%"
the problem is if I hit the victim the name if goin to be the max healt but if I wait a tick the name will be the life the mob have now. But if I put wait a tick the cancel event won't work. If I remove cancel event if the spider die and the chance of 15% active the spider will be all red and is just so hard to explain I just upload a photo
2018-05-01_18.03.58.png
the spider is like death but can hit you and is harder to kill
[doublepost=1525212507][/doublepost]
What is your code referencing the function?
[doublepost=1525212017,1525211852][/doublepost]try this
it loaded for me
code_language.skript:
function name(p: player):
    wait a tick
    set the display name of {_p} to "lol"
Thanks I will try later or tomorrow
[doublepost=1525295562][/doublepost]
What is your code referencing the function?
[doublepost=1525212017,1525211852][/doublepost]try this
it loaded for me
code_language.skript:
function name(p: player):
    wait a tick
    set the display name of {_p} to "lol"
shane thanks it works. But the victim is a zombie not a player and I cant do victim because is not a function arg type. what should I use ?
 
i can't seem to figure it out using the function, but also, you dont need a function to perform one line, I would suggest right after your event just put
set display name of victim to "lol"
 
Status
Not open for further replies.