Been looking around and can't seem to find a post that has a code that works lol. Tried numerous.
Just need a simple code so when you type !website it opens the url.
Tried this but it does absolutely nothing:
hook.Add( "PlayerSay", "DonatePlayerSay", function( pl, str, isteam )
if( string.sub( str, 1, 7 ) == "!website" ) then
pl:SendLua([[gui.OpenURL("http://anondino.wixsite.com/mega-rp")]]);
PrintMessage( HUD_PRINTTALK, pl:Nick() .. " has gone to !website" );
return "";
end
end );
Send a net message to the client which runs gui.OpenURL clientside.
What if I were to put this in lua/autorun/client?
Should work.
Placing
if ( SERVER ) then
hook.Add( "PlayerSay", "steamgroupcommand", function( _p, _text, public )
if ( _text == "!website" ) then
_p:ConCommand( "steamgroup" );
return "";
end
end );
else
concommand.Add( "steamgroup", function()
gui.OpenURL( "http://steamcommunity.com/groups/redpredatorgaming" );
end );
end
in lua/autorun/client doesn't seem to work.
It doesn't even send the error to console now.
Sorry, you need to Log In to post a reply to this thread.