• Entity:GetName() not giving me anything.
    1 replies, posted
Here is my script: hook.Add("PlayerDeath","PlayerDeathHook", function(victim,inflictor,attacker)   message = (victim:Nick() .. " died")   randnum = math.random(1,5)     --I know this probably isn't the most effective way to do this but whatever     if randnum == 1 then       message = (victim:Nick() .. " got rekt by " .. attacker:GetName() .. " wielding a " .. inflictor:GetName() .. ".")     end     if randnum == 2 then       message = (victim:Nick() .. " was slain by a crazy " .. attacker:GetName() .. " with an illegally obtained " .. inflictor:GetName() .. ".")     end     if randnum == 3 then       message = (victim:Nick() .. " died tragically because " .. attacker:GetName() .. " went on a massacre using a big " .. inflictor:GetName() .. ".")     end     if randnum == 4 then       message = (victim:Nick() .. " passed away because " .. attacker:GetName() .. " slipped on a slippery " .. inflictor:GetName() .. ".")     end     if randnum == 5 then       message = (victim:Nick() .. " commit suicide because " .. attacker:GetName() .. " had a " .. inflictor:GetName() .. " whilst " .. victim:Nick() .. " didn't.")     end   PrintMessage(3,message) end) When I die from a combine soldier or something it just spits out: "Neo got rekt by wielding a ." So why am I not getting anything? Thanks!
I think you want to use GetClass() since GetName is used by hammer
Sorry, you need to Log In to post a reply to this thread.