LUA: When players says a specific sentence then activate function!
5 replies, posted
Can anyone help me? i want (lets say) when you type "Test" in the chat the function (that i named "testfunc") to be activated! please help me =)
Use the hook
[lua]
local function Test(ply, text)
--stuf here
end
hook.Add("OnPlayerChat", "Name" Test)
[/lua]
[QUOTE=havejack;41204408]Use the hook
[lua]
local function Test(ply, text)
--stuf here
end
hook.Add("OnPlayerChat", "Name" Test)
[/lua][/QUOTE]
I tried using this but it gives me lua error :/
[QUOTE=havejack;41204408]Use the hook
[lua]
local function Test(ply, text)
--stuf here
end
hook.Add("OnPlayerChat", "Name", Test)
[/lua][/QUOTE]
you forgot a comma after "Name"
[QUOTE=dave1120;41204855]I tried using this but it gives me lua error :/[/QUOTE]
If you couldn't figure out what was wrong with that barebones sample you should step back from modding and read up on LUA documentation first.
[QUOTE=Bletotum;41205063]If you couldn't figure out what was wrong with that barebones sample you should step back from modding and read up on LUA documentation first.[/QUOTE]
Lol, sorry. Weed + Lua. And thank you :)
Sorry, you need to Log In to post a reply to this thread.