Im trying to make a game where every second you jump power gets higher and higher and when the player dies it just resets the players jump power.At the start of the game you press a button to start the jump loop. Here is the 2 scripts. There is also a intvalue called jumpPower and a remote event called jump
server script in server script service
local Jump = game.ReplicatedStorage.Jump local jumpPower = game.ReplicatedStorage.JumpPower Jump.OnServerEvent:Connect(function(plr) print("event called") local char = plr.Character jumpPower.Value = 2 local humanoid = char:FindFirstChild("Humanoid") function Jump() while wait(1) do jumpPower.Value += 1.5 humanoid.JumpPower = jumpPower.Value wait(1) print(humanoid.JumpPower) end end Jump() plr.CharacterAdded:Connect(function(char) char:FindFirstChild("Humanoid").JumpPower = jumpPower.Value end) end)
local script
local plr = game.Players.LocalPlayer local Button = script.Parent.TextButton local Label = script.Parent.TextLabel local door = game.Workspace.Door local debounce = false local char = plr.Character local jumpPower = 2 local jump = game.ReplicatedStorage.Jump Label.Visible = false door.CanCollide = true door.Transparency = 0.2 Button.Visible = true Button.MouseButton1Click:Connect(function() if debounce == false then debounce = true Label.Visible = true for i = 5, 0, -1 do Label.Text = "Starting in "..i.." Seconds" wait(1) end Label.Visible = false door.CanCollide = false door.Transparency = 1 Button.Visible = false jump:FireServer(plr) end end)
The reason why Its resetting the jump power Is because ROBLOX Is actually forcing the player to reset the jump power, Inside of the "StarterPlayer" folder, and check "Character Jump Setting" The player jump power will always be set to 50 each time the player respawn, so I would say, try to make a script that saves the current player jump power