ChatReactionGame.sk

Created by DragonPaws

Just so you know, we don't know the file format for every file. If it's just a bunch of random characters, it's probably a .zip or .jar.

#Made by Dragon Paws
#Version 1.0.0.0.0.0

#Config
options:
	Error_Message: &cSomething went wrong, check syntaxes. #Error Message
	permission_message: &cNo. #if the player dosnt have permission
	Main_Color: &d #Coloring 
	Secondary_Color: &f #Coloring
	Reward: give %player% 1 diamond #A command. If you use essentials and money you can use "eco give %player% 10"
	Time: 10 #How many minutes beetween reactions.
	


#Code do touch if you want
command /reactions [<text>] [<text>]:
	permission: reactions.use
	permission message: {@permission_message}
	trigger:
		if arg-1 is set:
			if arg-1 is "add":
				if arg-2 is set:
					if {reactions::*} does not contain arg-2:
						add arg-2 to {reactions::*}
						message "{@Main_Color}Reactions {@Secondary_Color}» {@Main_Color}%arg-2% {@Secondary_Color}has been added to the reactions games."
					else:
						message "{@Main_Color}Reactions {@Secondary_Color}» {@Main_Color}%arg-2% {@Secondary_Color}is already in the reaction game."
				else:
					message "{@Error_Message}"
			if arg-1 is "remove":
				if arg-2 is set:
					if {reactions::*} contains arg-2: 
						remove arg-2 from {reactions::*}
						message "{@Main_Color}Reactions {@Secondary_Color}» {@Main_Color}%arg-2% {@Secondary_Color}has been removed from the reactions games."
						stop
					else:
						message "{@Main_Color}Reactions {@Secondary_Color}» {@Main_Color}%arg-2% {@Secondary_Color}is not in the reaction game."
				else:
					message "{@Error_Message}"
			if arg-1 is "list":
				if arg-2 is not set:
					if {reactions::*} is set:	
						message "{@Main_Color}Reactions {@Secondary_Color}» {@Main_Color}%{reactions::*}%."
				if {reactions::*} is not set:
					message "{@Main_Color}Reactions {@Secondary_Color}» Set a reaction first with /reaction add [reaction]"
			if arg-1 is "now":
				set {reaction} to random element out of {reactions::*}
				set {reaction.now} to now
				send formatted "<tooltip:{@Main_Color}%{reaction}%>{@Main_Color}Reactions {@Secondary_Color}» Hover over the {@Main_Color}reaction {@Secondary_Color}and spell it out!" to all players
			if arg-1 is not "now" or "list" or "remove" or "add":
				message "{@Error_Message}"
		else:
			message "{@Main_Color}Reactions {@Secondary_Color}» Commands"
			message "{@Secondary_Color}» {@Main_Color}/reactions now"
			message "{@Secondary_Color}» {@Main_Color}/reactions add [Reaction]"
			message "{@Secondary_Color}» {@Main_Color}/reactions remove [Reaction"
			message "{@Secondary_Color}» {@Main_Color}/reactions list"
			


on chat: 
	if message contains {reaction}:
		cancel event
		set {difference.REACTION} to difference between {reaction.now} and now
		broadcast "{@Main_Color}Reactions {@Secondary_Color}» {@Main_Color}%player% {@Secondary_Color}has gotten {@Main_Color}%{reaction}% {@Secondary_Color}in {@Main_Color}%{difference.REACTION}%"
		make console execute command "{@Reward}"
		clear {reaction}
		clear {reaction.now}
		clear {difference.REACTION}

every {@Time} minutes:
	set {reaction} to random element out of {reactions::*}
	set {reaction.now} to now
	send formatted "<tooltip:{@Main_Color}%{reaction}%>{@Main_Color}Reactions {@Secondary_Color}» Hover over the {@Main_Color}reaction {@Secondary_Color}and spell it out!" to all players