Help - doesnt 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 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.

Nacktbild

Member
Mar 15, 2019
3
0
1
on rightclick:
set {_waited} to difference between {flashheal.%player%.lastused} and now
if player's tool is magenta dye:
if name of player's tool is "&d&lFlash Heal":
if {_waited} is less than 10 seconds:
send "Du musst %difference between 10 seconds and {_waited}% warten bevor du den Befehl wieder benutzen kannst!"

else if {_waited} is more than 10 seconds:
send "Success"
increase the player's health by 3
send title "&7Du hast ein &d&lFlash Heal" with subtitle "&7benutzt" for 1 seconds
remove 1 magenta dye named "&d&lFlash Heal" with lore "&fDieses Item heilt dich um +&c3 Herzen&f," and "&fwenn du es &6&lRechtsklickst&f!" from player's inventory
set {flashheal.%player%.lastused} to now
stop


Whats the Problem? Nothing happens when I rightclick the item ( I get no errors )
It only works with my main account rn, but with no other account. Nothing happens.
 
on rightclick:
set {_waited} to difference between {flashheal.%player%.lastused} and now
if player's tool is magenta dye:
if name of player's tool is "&d&lFlash Heal":
if {_waited} is less than 10 seconds:
send "Du musst %difference between 10 seconds and {_waited}% warten bevor du den Befehl wieder benutzen kannst!"

else if {_waited} is more than 10 seconds:
send "Success"
increase the player's health by 3
send title "&7Du hast ein &d&lFlash Heal" with subtitle "&7benutzt" for 1 seconds
remove 1 magenta dye named "&d&lFlash Heal" with lore "&fDieses Item heilt dich um +&c3 Herzen&f," and "&fwenn du es &6&lRechtsklickst&f!" from player's inventory
set {flashheal.%player%.lastused} to now
stop


Whats the Problem? Nothing happens when I rightclick the item ( I get no errors )
It only works with my main account rn, but with no other account. Nothing happens.
Try:
code_language.skript:
if name of player's held item contains "&d&lFlash Heal":
[doublepost=1552939089,1552939030][/doublepost]And use the code = skript format when publishing codes.
 
Try:
code_language.skript:
if name of player's held item contains "&d&lFlash Heal":
[doublepost=1552939089,1552939030][/doublepost]And use the code = skript format when publishing codes.
Actually "player's tool" and "player's held item" is the same. I think it just messes up with some conditon thanks to the cooldown OR the name is not recognised correctly. Therefore I'd use "if uncoloured name of player' tool = "":"
 
Does'nt work.
I can still only rightclick it with my Main account, any other players cant use it.
 
under your else if add onother else statement setting the variable to now. I think you have just tried too often with your main account and therefore the variables are already being set. But for other players it will never be set
 
under your else if add onother else statement setting the variable to now. I think you have just tried too often with your main account and therefore the variables are already being set. But for other players it will never be set
That wasnt working for me.
But I just made a new file, copied the code and tried to change the ''flashheal.%player%.lastused"
to ''cake.%player%.lastused" (like the example for the cooldown command is)

That is working fine for me.
When I change it to something else, its broken. (Nothing happens)

The thing is I need more than 1 of them because I have 5 Items that need cooldowns...

Some 1 know the problem?

Code:
on rightclick:
    set {_waited} to difference between {cake.%player%.lastused} and now
    if player's tool is magenta dye:
        if name of player's tool is "&d&lFlash Heal":
            if {_waited} is less than 10 seconds:
                send "Du musst %difference between 10 seconds and {_waited}% warten bevor du den Befehl wieder benutzen kannst!"
               
            else if {_waited} is more than 10 seconds:
                send "Success"
                increase the player's health by 3
                send title "&7Du hast ein &d&lFlash Heal" with subtitle "&7benutzt" for 1 seconds
                remove 1 magenta dye named "&d&lFlash Heal" with lore "&fDieses Item heilt dich um +&c3 Herzen&f," and "&fwenn du es &6&lRechtsklickst&f!" from player's inventory
                set {cake.%player%.lastused} to now
[doublepost=1553005034,1553004764][/doublepost]Update:

seems only work when I add


Code:
            else if {cake1.%player%.lastused} is not set:
                set {cake1.%player%.lastused} to now
                stop
 
Status
Not open for further replies.