Skript icon indicating copy to clipboard operation
Skript copied to clipboard

Skript "On Chat" event doesnt follow command "stop"

Open MuelTheFox opened this issue 7 years ago • 1 comments

So I'm trying to write code using skript for this custom /nickname command, and what my problem is, is that im using an On Chat event, so when they type /nickname it asks them in chat "Say the colour you want your name to be". So they would say yellow or green in chat and once they say yellow or green console would change there nickname to that color but keep there regular in game name, my problem is after they say their color they are still able to say another color in chat and have it change again, and again, the event doesnt stop after they type the first color.

My code:

command /nickname:
	permission: tc.nickname.nickname
	permission message: &bYou do not have permission to execute this command.
	trigger:
		send "&bType the color you would like your name to be."
		send "&bType '&e/nicknamelist&b' to view the allowed and blacklisted colors."
on chat:
	cancel event
	if message is "green":
		send "&bYour name has been changed too '&2%player%&b'!"
		make console execute command "enickname %player% &2%player%"
		wait 1 tick
		stop
	if message is "white":
		send "&bYour name has been changed too '&f%player%&b'!"
		make console execute command "enickname %player% &f%player%"
		wait 1 tick
		stop
	if message is "yellow":
		send "&bYour name has been changed too '&e%player%&b'!"
		make console execute command "enickname %player% &e%player%"
		wait 1 tick
		stop

If you have any questions let me know!

MuelTheFox avatar Dec 07 '17 04:12 MuelTheFox

Hey there!

This version of Skript is unsupported and outdated. If you would like to join an awesome Skript community that has a forums and Discord chat, check out skunity.com they also have an updated database of Skript addons and documentation there too!

antoniojamore avatar Dec 27 '17 23:12 antoniojamore