Using a Wildcard in a condition

Well, I’m making a head crab take over script, and I need to use a wildcard. However, it will not let me use it. Its actually looking for an NPC named npc_headcrab*.
Please help

The console:



Lua initialized (Lua 5.1)
Registering gamemode 'sandbox' derived from 'base'
ScriptEnforce is disabled
Executing listen server config file
exec: couldn't exec listenserver.cfg
InitFastCopy: only 51% fast props. Bug?
Lua initialized (Lua 5.1)
Registering gamemode 'sandbox' derived from 'base'
Sending 267 'User Info' ConVars to server (cl_spewuserinfoconvars to see)
Redownloading all lightmaps
NPC undone
NPC undone
NPC undone


The script:
[lua]
function Headcrab(target, inflictor)
if inflictor:GetClass() == “npc_headcrab*” and target:IsPlayer() then
local a = {}
a[“npc_headcrab”] = “npc_zombie”
a[“npc_headcrab_fast”] = “npc_fastzombie”
a[“npc_headcrab_black”] = “npc_poisonzombie”
local zombie = ents.Create(a[inflictor:GetClass()])
zombie:SetPos(target:GetPos())
zombie:SetHealth(200)
zombie:Spawn()
zombie:SetAngles(target:GetAngles())
target:Spectate(OBS_MODE_CHASE)
target:SpectateEntity(zombie)
target:KillSilent()
end
end

hook.Add(“EntityTakeDamage”, “23924812”, Headcrab)
[/lua]
Also setangles doesn’t work

[lua]if string.find(inflictor:GetClass(),“npc_headcrab”)[/lua]

**[String.find

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=String.find)**

Use **[String.find

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=String.find)** on inflictor:GetClass().

Oh, thanks!

On the server,


if inflictor:IsNPC( ) and inflictor:Classify( ) == CLASS_HEADCRAB then

**[NPC.Classify

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=NPC.Classify)**