Script not working

I want this script to tween the volume, and fog when the player reaches 1 health.

Server Script -

game.ReplicatedStorage.Death.OnServerEvent:Connect(function(player)
   local tweenser = game:GetService("TweenService")
   
   local goal = {}
   goal.PlaybackVolume = 0
   
   local e = TweenInfo.new(2)
   
   
   local tw = tweenser:Create(game.Workspace["Insanity Sans (Shifty Edition)"],e,goal)
   
   tw:Play()
   
   for i,v in pairs(game.Lighting:GetChildren()) do
   	v:Destroy()
   end
   wait(4)
   
   local goal2 = {}
   goal2.FogStart = 22
   goal2.FogEnd = 22

   local ee = TweenInfo.new(6)


   local tww = tweenser:Create(script.Parent,e,goal)
   
   tww:Play()
   
end)

Local Script -

local char = game.Players.LocalPlayer.Character:WaitForChild('Humanoid')


if char.Health <5 then
	game.ReplicatedStorage.Death:FireServer()
	wait(9)
	game.Players.LocalPlayer:Kick('heheheh, it was comming to ya.')
end 

Did you use Death.OnServerEvent in the server script? Your code seems to be cut off in a lot of places, I can’t tell what the problem is.

I edited it, hopefully it would help.

Where does the code error? Or does it return nothing? If it returns nothing, put prints every couple lines and see where it stops printing. Narrow it down to the line that stops code from running.

Ok, it dosent return anything so ill see where it stops.

Do that whenever you come across a problem like this. Debugging is important.

Also

game.Players.LocalPlayer:Kick('heheheh, it was comming to ya.')

Won’t properly kick the player since it’s on the client