I have been struggling with changing the walkspeed of a players humanoid upon them respawning after dying, i get no errors while testing - I am using RemoteEvent, i am not sure if that is neccesary
LocalScript is in the StarterCharacterScripts folder
-- LocalScript
local plr = game.Players.LocalPlayer
local char = script.Parent
local hum = char:WaitForChild("Humanoid")
local humroot = char:WaitForChild("HumanoidRootPart")
local function onDeath()
game.ReplicatedStorage.AddStats:FireServer()
end
hum.Died:Connect(onDeath)
-- Script
game.ReplicatedStorage.AddStats.OnServerEvent:Connect(function(plr)
local char = plr.Character
local hum = char:WaitForChild("Humanoid")
local gui = plr.PlayerGui:WaitForChild("ValueGui")
local textLabel = gui.JumpValue
local walkSpeed = hum.WalkSpeed
local jumpPower = hum.JumpPower
print("Stats saved!")
plr.CharacterAdded:Connect(function()
print("character respawned")
char:WaitForChild("Humanoid").WalkSpeed = walkSpeed
hum.JumpPower = jumpPower
end)
end)

3 comments
My bad, i didnt describe it well enough. The idea of the game is that your walkspeed increases every few seconds and so does your JumpPower and i want to store the players speed and jump when they die so i can give them the exact amount of speed and jump they had before they died.
Thank you - I just tried it and it worked. I think the solution might just have been using GetPropertyChangedSignal.
I'm glad it worked. Would you please accept my answer if it helped? Then others don't have to respond anymore.