i am not completely sure on how to do this. I would need a math.random in it somewhere to make sure it doesnt always give the item when killed right but how would i get the player/character that killed the monster - that would be a objectvalue named creator? however i only know how to do that with a leaderstats with money. how would i give the item to the player
local plr = game.Players.LocalPlayer
script.Parent.Handle.Touched:connect(function(hit)
if hit.Parent.Name == 'DroolingZombie' or 'Zombie' then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
local tag = Instance.new('ObjectValue',hit.Parent.Humanoid)
tag.Name = 'creator'
tag.Value = plr
wait(3)
tag:Destroy()
end
end
end)
this is the code in the sword
