Hello, I have a TTT server and the following LUA code isn't running properly:
[CODE]function webCommand( pl, text, teamonly )
if (text == "!donate") then
pl:SendLua([[gui.OpenURL("http://yoshismod.ml/donate")]]) -- Change ADDRESS to your chosen page.
end
function webCommand( pl, text, teamonly )
if (text == "!css") then
pl:SendLua([[gui.OpenURL("http://yoshismod.ml/forum/m/40072318/viewthread/28373145-installing-css-content-on-your-garrys-mod-to-fix-unknown-textures-errors/page/1")]]) -- Change ADDRESS to your chosen page.
end
end
hook.Add( "PlayerSay", "Chat", webCommand )[/CODE]
What happens is only one of them works. I think its probably because of a conflict. Any ideas why?
Okay, thanks so much! That makes a lot of sense, and I'm still new to lua coding so its kind of difficult for me
To be clear you mean it should look like this right
[CODE]function webCommand( pl, text, teamonly )
if (text == "!donate") then
pl:SendLua([[gui.OpenURL("http://yoshismod.ml/donate")]]) -- Change ADDRESS to your chosen page.
if (text == "!css") then
pl:SendLua([[gui.OpenURL("http://yoshismod.ml/forum/m/40072318/viewthread/28373145-installing-css-content-on-your-garrys-mod-to-fix-unknown-textures-errors/page/1")]]) -- Change ADDRESS to your chosen page.
end
end
hook.Add( "PlayerSay", "Chat", webCommand )[/CODE]
[code]function webCommand(pl, text, teamonly)
if (text == "!donate") then
pl:SendLua([[gui.OpenURL("http://yoshismod.ml/donate")]]) -- Change ADDRESS to your chosen page.
elseif (text == "!css") then
pl:SendLua([[gui.OpenURL("http://yoshismod.ml/forum/m/40072318/viewthread/28373145-installing-css-content-on-your-garrys-mod-to-fix-unknown-textures-errors/page/1")]]) -- Change ADDRESS to your chosen page.
end
end
hook.Add("PlayerSay", "Chat", webCommand)[/code]
Sorry, you need to Log In to post a reply to this thread.