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)

2 comments
Why is the server script same as the local script??
To start, the "CharacterAdded" event never gets reached. The Jump() function contains a while loop so until that while loop is exited or breaks -- code after that line will never run.