I am trying to make the leaderstats value equal the jumpheight of the player but when the button is pressed the leaderstats isn’t changing, i tried this in a local script and server script.
local script
local rs = game:GetService("ReplicatedStorage")
local remotevent = rs.StatsIncrease
local plr = game.Players.LocalPlayer
JUMPHEIGHT_INCREASE = 0.05
script.Parent.MouseEnter:Connect(function()
end)
script.Parent.MouseButton1Click:Connect(function()
plr.Character.Humanoid.JumpHeight = plr.leaderstats.JumpPower.Value
remotevent:FireServer(JUMPHEIGHT_INCREASE)
end)
server script:
local rs = game:GetService("ReplicatedStorage")
local remotevent = rs.StatsIncrease
remotevent.OnServerEvent:Connect(function(player, JUMPHEIGHT_INCREASE)
player.Character.Humanoid.JumpHeight += JUMPHEIGHT_INCREASE
end)