• Kill Words
    7 replies, posted
I'm looking for someone to make a script that triggers the concommand "Kill" when a defined word is said in chat. If it's possible, could the player also explode on death? I'd really appreciate any help with this, Thanks in advance. :shobon:
Something like this? [lua]local killwords = { "kill", "lolwut" } local function explode(ply) local explode = ents.Create("env_explosion") explode:SetPos(ply:GetPos()) explode:Spawn() explode:SetKeyValue("iMagnitude", "220") explode:Fire("Explode", 0, 0) explode:EmitSound("weapon_AWP.Single", 400, 400) ply:Kill() end hook.Add("PlayerSay", "Killwords", function(ply, text) for _, w in ipairs(killwords) do if text:lower():find(w) then explode(ply) break end end end)[/lua] Goes in lua/autorun/server/ (untested)
Tested, works great. Thanks MakeR, you're a life saver :buddy:
[QUOTE=xboxhumper;22254594]Thanks MakeR, you're a [B]life saver[/B] :buddy:[/QUOTE] Well thats pretty ironic as this kills virtual people ::v:
[QUOTE=Falchion;22255706]Well thats pretty ironic as this kills virtual people ::v:[/QUOTE] Haha, I guess you're right. I just noticed something while using this script too, the env_explosion damages other players/props. Is there any way to stop this?
Anyone?
I don't think theres a way to fix that unless you make it shoot them instead of exploding.
[QUOTE=xboxhumper;22255852]Haha, I guess you're right. I just noticed something while using this script too, the env_explosion damages other players/props. Is there any way to stop this?[/QUOTE] Set the iMagnitude to "0".
Sorry, you need to Log In to post a reply to this thread.