Health updated on server, but does not show for the client

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? For the client to see their hp.

  2. What is the issue? My script heals them, yet they cannot see their health increase, though it does on the server. I’ve tested this in client-server testing.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub? I did, although I’ve found nothing like this.

-- Local Script 
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local uis = game:GetService('UserInputService')

local rs = game:GetService('ReplicatedStorage')
local siphonEvent = rs:WaitForChild("Fire")

uis.InputBegan:Connect(function(input, typing)
	if typing then return end
	if input.KeyCode == Enum.KeyCode.E then
		mouse.Button1Down:Connect(function()
			local model = mouse.Target:FindFirstAncestorOfClass('Model')

			if model then
				local clickedPlayer = game.Players:GetPlayerFromCharacter(model)

				if clickedPlayer then
					siphonEvent:FireServer(clickedPlayer)
				end
			end
		end)
	end
end)

-- Server Script
local rs = game:GetService('ReplicatedStorage')
local siphonEvent = rs:WaitForChild("Fire")

siphonEvent.OnServerEvent:Connect(function(player,clickedPlayer)
	local damageDealt = clickedPlayer.Character.Humanoid.MaxHealth / 10 * 3 / 10
	
	clickedPlayer.Character.Humanoid.WalkSpeed = 0
	clickedPlayer.Character.Humanoid.JumpPower = 0

	for i = 1,10 do
		clickedPlayer.Character.Humanoid:TakeDamage(damageDealt)
		if player.Character.Humanoid.Health < player.Character.Humanoid.MaxHealth then
			player.Character.Humanoid.Health += damageDealt 
		end
		print(player, player.Character.Humanoid.Health)
		wait(0.2)
	end
	
	damageDealt = 0
	
	clickedPlayer.Character.Humanoid.WalkSpeed = 16
	clickedPlayer.Character.Humanoid.JumpPower = 50
end)

did you update their status to the local data base? so its public?

It’s probably also worth mentioning that the damage bit is also bugged and will go from 30% to 60%, 90% etc each time you kill someone with it/they die. I haven’t found the cause. I’ll make a different post for that.

It’s damaging the clickedPlayer, not the player.

1 Like

I thought the server’s health automatically replicated?

The server health doesn’t replicate, apparently, according to the Developer Wiki. Correct me if I’m wrong, please. Here’s the link to the Wiki page, it says Humanoid.Health is not replicated. Humanoid.Health

It sounds dumb - I know. For me, the server health has always replicated properly.

Maybe report this in #bug-reports:engine-bugs?

Also with the player being damaged, they can see their health go down?

Sorry but I’m no longer sure about this… I looked this issue up and found nothing as well. For weapons I’ve made in the past, health always replicated from the server to client properly. Probably an engine bug.

And once you’ve clicked once, you can see your health go up. For example, if Player1 siphoned Player2, even if Player1’s health was not full, it wouldn’t heal Player1, but if Player2 then siphoned them, Player2 would get healed.