I need help on how I send the player's health to their client GUI from the server script. I already wrote up the client-side script, but I need help on how to send it from server-side. Any help?
Server:
function game.ReplicatedStorage.PlayerHealth.OnServerInvoke(player)
local health = player.Character:WaitForChild("Humanoid")
--Unsure of what to do here.
end
Client (If needed to test):
local Health = script.Parent.Parent.Parent.Parent.Character.Humanoid
while true do
game.ReplicatedStorage.PlayerHealth:InvokeServer()
PlayerHealth = Health.Health
PlayerMaxHealth = Health.MaxHealth
wait(.1)
script.Parent.Text = (math.floor(PlayerHealth) .. " / " .. math.floor(PlayerMaxHealth) )
wait(.1)
end
