It's for regaining all of your health when you kill a player, I need to know why it's not working.
Players = game:GetService("Players") -- In case someone renames Players or something
Players.PlayerAdded:connect(function(Player) -- When someone joins
--// You can add other stuff here, too.
Player.CharacterAdded:connect(function(Character) -- When they respawn (Get a new Character)
local Humanoid = Character:WaitForChild("Humanoid") -- Find Humanoid
Humanoid.Died:connect(function() -- Detects for when the Humanoid dies
if Humanoid:FindFirstChild("creator") ~= nil then -- Checks for a Killed
local Killer = Humanoid.creator.Value -- Gets Killer
local player = game.Players.LocalPlayer -- Gets the player
local char = player.Character --Gets the player's character
char.Humanoid.MaxHealth = 100 --Sets the MaxHealth of the Humanoid to 100
char.Humanoid.Health = 100 --Sets the health to 100, so that the player is at full HP)
end -- Ends the if
-- For the Dead guy, you can do stuff to him here.
end)
end)
end) -- Another End w/ a Bracket

4 comments
Ok hold on I'm confused, is the Killer suppose to be the vampire? If that is the case, then this is not working because you are setting the health for the dead player
Also, a serverscript cannot define the local player
Then what should I do?
Creator is not rly a good think to use when dealing with deaths.