Aller au contenu
Aurore

Système cooldown sur des items

Messages recommandés

Version Serveur 1.8

Version skript 1.8

Addons : Skript,skUtilities,TuSKe

Bonjour,

j'ai actuellement des items perso donnant certain effet mais les joueurs peuvent manger l'item autant qu'il veulent et sa ça vas être injouable du coup je me demandais comment faire pour qu'une fois que l'item est mangé il ai un cooldown de 4 minutes afin d'éviter au joueur d'en manger toutes les secondes et aussi comment faire pour que la personne puisse manger l'item même si sa barre de faim est complète un peux comme avec les pomme dorée ^^"

merci d'avance 

 

Partager ce message


Lien à poster
Partager sur d’autres sites
Invité

Bonjour, pour répondre à ta question il faudrait mettre un timer quand les effets sont donnés tu pourrait me donner ton code.

Quand le joueur reçoi les effet:

set {timer.item.%player%} to 4 #4 est le nombre de minutes à attendre.
set {util.item.%player%} to false

Pour les vérifications lors du click sur l'item:

if {util.item.%player%} is set:
	send "&cVous ne pouvez pas encore utilisé un item spécial. Tu pourra l'utiliser dans %{timer.item.%player%}%"
    cancel event
else:
	<Ici tu mets ton code abituel>

A mettre dans le code:

every 1 minute:
	loop all players:
    	if {timer.item.%player%} is set:
        	if {timer.item.%player%} is 0:
            	clear {util.item.%player%}
            else:
            	remove 1 from {timer.item.%player%}

Si cela ne fonctionne pas dit le moi.

 

 

 

Partager ce message


Lien à poster
Partager sur d’autres sites
il y a 4 minutes, Killbinvlog a dit :

Bonjour, pour répondre à ta question il faudrait mettre un timer quand les effets sont donnés tu pourrait me donner ton code.

Contenu masqué

    Réagissez ou répondez à ce message afin de consulter le contenu masqué.

Si cela ne fonctionne pas dit le moi.

je testerais ça une fois que je pourrais repartir sur mon serv

merci

 

 

 

Partager ce message


Lien à poster
Partager sur d’autres sites
Invité

Ok merci !

Partager ce message


Lien à poster
Partager sur d’autres sites
Le 04/03/2019 à 14:03, Killbinvlog a dit :

Ok merci !

Voici les erreurs affiché 
 

[16:11:54] [Server thread/ERROR]: indentation error: expected 1 tab, but found 4 spaces (haste.sk, line 10: cancel event')
[16:11:54] [Server thread/WARN]: Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section. (haste.sk, line 11: else:')
[16:11:54] [Server thread/ERROR]: indentation error: expected 2 tabs, but found '____->' [-> = tab, _ = space, ? = other whitespace] (haste.sk, line 17: if {timer.item.%player%} is set:')
[16:11:54] [Server thread/ERROR]: indentation error: expected 2 tabs, but found '________->' [-> = tab, _ = space, ? = other whitespace] (haste.sk, line 18: if {timer.item.%player%} is 0:')
[16:11:54] [Server thread/ERROR]: indentation error: expected 2 tabs, but found '____________->' [-> = tab, _ = space, ? = other whitespace] (haste.sk, line 19: clear {util.item.%player%}')
[16:11:54] [Server thread/ERROR]: indentation error: expected 2 tabs, but found 12 spaces (haste.sk, line 20: else:')
[16:11:54] [Server thread/ERROR]: indentation error: expected 2 tabs, but found '____________->' [-> = tab, _ = space, ? = other whitespace] (haste.sk, line 21: remove 1 from {timer.item.%player%}')
[16:11:54] [Server thread/WARN]: Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section. (haste.sk, line 16: loop all players:')
[16:11:54] [Server thread/ERROR]: indentation error: expected 2 tabs, but found '____->' [-> = tab, _ = space, ? = other whitespace] (haste.sk, line 27: if {timer.item.%player%} is set:')
[16:11:54] [Server thread/ERROR]: indentation error: expected 2 tabs, but found '________->' [-> = tab, _ = space, ? = other whitespace] (haste.sk, line 28: if {timer.item.%player%} is 0:')
[16:11:54] [Server thread/ERROR]: indentation error: expected 2 tabs, but found '____________->' [-> = tab, _ = space, ? = other whitespace] (haste.sk, line 29: clear {util.item.%player%}')
[16:11:54] [Server thread/ERROR]: indentation error: expected 2 tabs, but found 12 spaces (haste.sk, line 30: else:')
[16:11:54] [Server thread/ERROR]: indentation error: expected 2 tabs, but found '____________->' [-> = tab, _ = space, ? = other whitespace] (haste.sk, line 31: remove 1 from {timer.item.%player%}')
[16:11:54] [Server thread/WARN]: Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section. (haste.sk, line 26: loop all players:')
[16:11:54] [Server thread/ERROR]: indentation error: expected 2 tabs, but found '____->' [-> = tab, _ = space, ? = other whitespace] (haste.sk, line 37: if {timer.item.%player%} is set:')
[16:11:54] [Server thread/ERROR]: indentation error: expected 2 tabs, but found '________->' [-> = tab, _ = space, ? = other whitespace] (haste.sk, line 38: if {timer.item.%player%} is 0:')
[16:11:54] [Server thread/ERROR]: indentation error: expected 2 tabs, but found '____________->' [-> = tab, _ = space, ? = other whitespace] (haste.sk, line 39: clear {util.item.%player%}')
[16:11:54] [Server thread/ERROR]: indentation error: expected 2 tabs, but found 12 spaces (haste.sk, line 40: else:')
[16:11:54] [Server thread/ERROR]: indentation error: expected 2 tabs, but found '____________->' [-> = tab, _ = space, ? = other whitespace] (haste.sk, line 41: remove 1 from {timer.item.%player%}')
[16:11:54] [Server thread/ERROR]: invalid line - all code has to be put into triggers (haste.sk, line 1: set {timer.item.%player%} to 4#4 est le nombre de minutes � attendre.')
[16:11:54] [Server thread/ERROR]: invalid line - all code has to be put into triggers (haste.sk, line 2: set {util.item.%player%} to false')
[16:11:54] [Server thread/ERROR]: can't understand this event: 'if {util.item.%player%} is set' (haste.sk, line 8: if {util.item.%player%} is set:')
[16:11:54] [Server thread/ERROR]: can't understand this event: 'else' (haste.sk, line 11: else:')

Partager ce message


Lien à poster
Partager sur d’autres sites
Invité
Ce sujet ne peut plus recevoir de nouvelles réponses.

×
×
  • Créer...

Information importante

Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer.