Jump to content

How to make skript check two variables for their contents?


MQXO

Recommended Posts

command /smsg <player> <text>:
	aliases: /smsg
	usage: &8[&b&lSodexMsg&8] &3/smsg <player> <text>
	trigger:
		if arg-1 and player are equal:
			send "&8[&3&lSodexMessaging&8] &c You can't send messages to youself, silly!" to player
		else: 
			send "&8[&3&lSodexMessaging&8] &f%player% messaged you: %arg-2%" to arg-1

Ok so basically I just want to know what i need to insert in "if arg-1 and player are equal" for equal because whatever i try doesn't work so thats pretty much all i need

Link to comment
Share on other sites

command /smsg [<offline player>] [<text>]:
	trigger:
		if arg-2 is set:
			if arg-1 is online:
				if arg-1 != player:
					send "(To %arg-1%) %arg-2%" to player
					send "(From %player%) %arg-2%" to arg-2
				else:	
					send "&cYou can not send a message to yourself!"
			else:
				send "&cThat player is offline!"
		else:
			send "&cFormat: /smsg <player> <message>"

something like this should work

Link to comment
Share on other sites

  • 1 month later...

yeah surprisingly i got back into skript and figured it out, my current skript as it stands is:
the "else if execute is console:" bit is because when sending messages from console the sender would appear as "none" but that solved it
 

on load:
	send "&8[&3&lSodexMessaging&8] &7Successfully loaded." to all players

command /smsg <player> <text>:
	aliases: /sodexmsg
	usage: &8[&b&lSodexMessaging&8] &3/smsg <player> <text>
	trigger:
		if arg-1 = player:
			send "&8[&3&lSodexMessaging&8] &c You can't send messages to youself, silly!" to player
		else if executor is console:
			send "&8[&3&lSodexMessaging&8] &bConsole &3>> &b%arg-2%" to arg-1
		else:
			send "&8[&3&lSodexMessaging&8] &b%player% &3>> &b%arg-2%" to arg-1

 

Edited by MQXO
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...