"Phrase" Promotion for ULX?

I basically need a Lua Script that promotes a user when they say a phrase. I’d use it for blocking users that don’t read my MOTD from doing anything other then walk around.

I’ll help you if you say please… Nobody ever says please…

Please? :v:

Something like this should work (place in lua/autorun/server):

[lua]
local phrase = “I read the MOTD.” – What the player has to say to get promoted.
local promoterank = “vip” – The rank it promotes to.
local defaultgroup = “user” – It will only promote the player if they’re at this rank. Pretty sure the default for ULX is still user.

hook.Add( “PlayerSay”, “Special ULX Phrase”, function( ply, text )

if !ulx then return end

if string.lower( text ) == string.lower( phrase ) then

	if !ply:IsUserGroup( string.lower( defaultgroup ) ) then return end
	
	-- taken from ulx.adduser function
	local userInfo = ULib.ucl.authed[ ply:UniqueID() ]

	local id = ULib.ucl.getUserRegisteredID( ply )
	if not id then id = ply:SteamID() end

	ULib.ucl.addUser( id, userInfo.allow, userInfo.deny, string.lower( promoterank ) )

	ulx.fancyLogAdmin( ply, "#A confirmed that the MOTD was read." )

end

end )[/lua]

I’ll give it a go when my server empties out, right now it’s completely full and I can’t close it for management or I’ll piss the community off. Thanks though.