Skript Version: Skript 2.4-beta10
Addons using (including versions): Skellett (1.9.8) - SkQuery (4.1.1) - skRayFall (1.9.18) - skUtilities (0.9.2)
Minecraft Version: 1.14.4
I've been trying to do something like that when a player right clicks on a sign, it opens a menu and on the menu there will be a mission to collect coal, if the player completes the mission a cooldown of 24 hours should start and the player has to wait until the next day to do the mission again.
My problem is that I can't get the "You have to wait" message to work and Cooldown is not working properly
Addons using (including versions): Skellett (1.9.8) - SkQuery (4.1.1) - skRayFall (1.9.18) - skUtilities (0.9.2)
Minecraft Version: 1.14.4
I've been trying to do something like that when a player right clicks on a sign, it opens a menu and on the menu there will be a mission to collect coal, if the player completes the mission a cooldown of 24 hours should start and the player has to wait until the next day to do the mission again.
My problem is that I can't get the "You have to wait" message to work and Cooldown is not working properly
Code:
on rightclick on sign:
1st line of clicked block is "Test":
open chest with 3 rows named "&3Misiones diarias" to player
format slot 12 of the player with a Coal named "&aMisión diaria" with lore "Colecciona 2 stacks de Carbón" to close then run [make player execute command "mission1"]
command /mission1:
trigger:
if {mission1.%player%} is not 1:
set {mission1.%player%} to 1
if number of all coal in player's inventory is less than 128:
message "Mine all the coal that is needed"
stop
else:
if player's inventory contains 128 coal:
wait 5 ticks
message ""
message "&2Mission complete!"
message ""
remove 128 coal from player's inventory
give player 1 diamond
else:
set {mission1.%player%.lastused} to now
set {_cooldown1.%player%} to difference between {mission1.%player%.lastused} and now
if {_cooldown1.%player%} is less than 24 hours:
message ""
message "&7 - Ya completaste esta misión hoy! -"
message "&7You have to wait &c%difference between 24 hours and {_cooldown1.%player%}% &7before you do this mission again"
message ""