I have 4 characters Officer, Agent, Culprit, & Innocent. I want to make it so if the Officer or agent kill an Innocent they die. I wrote this script and it doesnt seem to be working, all of the characters are defined later on in the script since this is just a small piece. If you have questions please ask and ill be sure to answer
function newcharacter(bloxxedplayer, character)
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
humanoid.Died:connect(function()
end)
end
end
-- Officer and agent no kill good guys
function newcharacter(bloxxedplayer, character)
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
humanoid.Died:connect(function()
local tag = humanoid:FindFirstChild("creator")
if tag and tag.Value and tag.Value.Parent == game.Players then
if tag.Value ~= culprit and bloxxedplayer ~= culprit then
local wrongdoer = tag.Value
if wrongdoer.Character and wrongdoer.Character.Parent then
local wrongdoerhumanoid =
wrongdoer.Character:FindFirstChild("Humanoid")
if wrongdoerhumanoid then
wrongdoerhumanoid.Health = 0
end
end
end
end
end)
end
end
