Don't work

  • 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.

Digszin

Member
Jan 26, 2017
28
0
1
33
code_language.skript:
on death of player:
    victim = player
    attacker = player
    set {_waited} to difference between {lagrima.%player%.lastused} and now
    if {_waited} is less than 5 minutes:
        drop shiny ghast tear
        set {lagrima.%player%.lastused} to now
When i kill my friend don't drop ghast tear
 
Code:
[LIST=1]
    set {_waited} to difference between {lagrima.%player%.lastused} and now
    if {_waited} is less than 5 minutes:
        drop shiny ghast tear
        set {lagrima.%player%.lastused} to now
[/LIST]

{_waited} is not set if you compare an empty variable, so it can't be compared to anything. Instead use:

Code:
    set {_waited} to difference between {lagrima.%player%.lastused} and now
    if {_waited} is less than 5 minutes:
        drop shiny ghast tear
        stop
   set {lagrima.%player%.lastused} to now
 
Code:
[LIST=1]
    set {_waited} to difference between {lagrima.%player%.lastused} and now
    if {_waited} is less than 5 minutes:
        drop shiny ghast tear
        set {lagrima.%player%.lastused} to now
[/LIST]

{_waited} is not set if you compare an empty variable, so it can't be compared to anything. Instead use:

Code:
    set {_waited} to difference between {lagrima.%player%.lastused} and now
    if {_waited} is less than 5 minutes:
        drop shiny ghast tear
        stop
   set {lagrima.%player%.lastused} to now
Don't work
 
By looking at the code, I know what's the error : you can't us "player" in a death event (which you use in the variable), you need to use "victim" or "attacker". You're lucky, because else, I would seriously have acknowledged you about not giving details.
 
code_language.skript:
on death:
    victim is a player
    attacker is a player
    drop shiny ghast tear named "&1Lagrima" at location of victim
    set {_waited} to difference between {lagrima.%victim%.lastused} and now
    if {_waited} is less than 5 minutes:
        drop shiny ghast tear
        set {lagrima.%victim%.lastused} to now
 
Status
Not open for further replies.