• "Phrase" Promotion for ULX?
    4 replies, posted
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... [url]http://steamcommunity.com/id/dylanb5123[/url]
[QUOTE=dylanb5123;36196642]I'll help you if you say please... Nobody ever says please... [url]http://steamcommunity.com/id/dylanb5123[/url][/QUOTE] 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]
[QUOTE=.\\Shadow};36198272]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][/QUOTE] 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.
Sorry, you need to Log In to post a reply to this thread.