Refering leaderstat's value to a property

So, I’m trying to create a script that gathers leaderstat data so that it can assign that data to a property. To be exact, I want it to change the property in the player’s humanoid. The health stat

local health = leaderstats:WaitForChild("Health")
local ki = leaderstats:WaitForChild("Ki")
local speed = leaderstats:WaitForChild("Speed")
local stamina = leaderstats:WaitForChild("Stamina")
local strength = leaderstats:WaitForChild("Strength")

These are my leaderstat values, if I should send any more information then let me know. I also would like to know whether it has to be a serverscript or a localscript, and in which category.

Every Instance has a function named GetPropertyChangedSignal, which returns an event that fires each time the specified property changes. This might be an easy way to implement: (I’m guessing you are placing this inside a PlayerAdded event in a ServerScript?)

game.Players.PlayerAdded:Connect(function(player)
    local leaderstats = player:WaitForChild("leaderstats")

    local health = leaderstats:WaitForChild("Health")
    local ki = leaderstats:WaitForChild("Ki")
    local speed = leaderstats:WaitForChild("Speed")
    local stamina = leaderstats:WaitForChild("Stamina")
    local strength = leaderstats:WaitForChild("Strength")

    health:GetPropertyChangedSignal("Value"):Connect(function()
        player.Character:FindFirstChildWhichIsA("Humanoid").Health = health.Value
    end)
end)

Thanks for the response, where do I put this script in and is it just this that I must paste in

First of all, have you created these stats already or are you waiting to create them?

If you already created these stats, you should place the GetPropertyChangedSignal inside the script in which you created those, I just gave out an example with the script I shared with you.

Okay, I’ll try to do it. Thanks for guiding me