So I want the player to become a zombie when they die but the problem is the localscript doesn’t do anything at all when the player dies.
player.CharacterAdded:Connect(function()
player:WaitForChild("Humanoid").Died:Connect(function()
print("LocalPlayer, “Has died!")
if workspace.Main.Game.Value == true then
workspace.ZombieDetect:FireServer()
print("hi")
end
end)
end)
Because Humanoid isn’t in the Player instance. You are trying to get the Humanoid from the Player instance, get it from the character instead. .CharacterAdded event also returns the character:
player.CharacterAdded:Connect(function(Character)
Character:WaitForChild("Humanoid").Died:Connect(function()
print("LocalPlayer, “Has died!")
if workspace.Main.Game.Value == true then
workspace.ZombieDetect:FireServer()
print("hi")
end
end)
end)
uhh you can’t use FireServer in the server script, you can only use <RemoteEvent>:FireClient() and setup the function in order for the event to start in the client