Jump multiplier not working

I have created a script that multiplies the players jump, but it would not work. An issue is, it wont multiply , and there is no errors. What I want this to do is to multiply the players jump by the TotalDrinks they have. If anyone can find a solution, it would be appreciated.
Code:

local Players = game:GetService("Players")
 
local function onCharacterAdded(char)
local plr = Players:GetPlayerFromCharacter(char)
local stats = plr:WaitForChild('leaderstats')
local waiting = stats:WaitForChild('TotalDrinks')
wait(1)
	char.Humanoid.JumpPower = char.Humanoid.JumpPower*waiting.Value/10+3-.4+1-.6	
--[[if char.Humanoid.JumpPower >= 300 then
	char.Humanoid.JumpPower = 300
	print("Child found, JumpPower was above 300. Ressurected back to 300. Located in onjoin")
end ]]
local function onPlayerAdded(player)
	player.CharacterAdded:Connect(onCharacterAdded)
end
 
Players.PlayerAdded:Connect(onPlayerAdded)



game.ReplicatedStorage.ChangeStats.OnServerEvent:Connect(function(playerr) --a local script fires the server if totaldrinks.value changed. No, this isn't where the issue is. If this area is deleted, the script still doesn't work.
	local sta = playerr:WaitForChild('leaderstats')
	local isit = sta:WaitForChild('TotalDrinks')
	local char = game.Workspace:FindFirstChild(playerr.Name)
	if char then
		char.Humanoid.JumpPower = char.Humanoid.JumpPower*isit.Value/10+3-.4+1-.6
		--[[		if char.Humanoid.JumpPower >= 300 then
			char.Humanoid.JumpPower = 300
			print("Child found, JumpPower was above 300. Ressurected back to 300. Located in OnServerEvent")
		end]]
	end
end)
end

You have misplaced the end.
This should work:

local Players = game:GetService("Players")
 
local function onCharacterAdded(char)
local plr = Players:GetPlayerFromCharacter(char)
local stats = plr:WaitForChild('leaderstats')
local waiting = stats:WaitForChild('TotalDrinks')
wait(1)
	char.Humanoid.JumpPower = char.Humanoid.JumpPower*waiting.Value/10+3-.4+1-.6	
--[[if char.Humanoid.JumpPower >= 300 then
	char.Humanoid.JumpPower = 300
	print("Child found, JumpPower was above 300. Ressurected back to 300. Located in onjoin")
end ]]
end
local function onPlayerAdded(player)
	player.CharacterAdded:Connect(onCharacterAdded)
end
 
Players.PlayerAdded:Connect(onPlayerAdded)



game.ReplicatedStorage.ChangeStats.OnServerEvent:Connect(function(playerr) --a local script fires the server if totaldrinks.value changed. No, this isn't where the issue is. If this area is deleted, the script still doesn't work.
	local sta = playerr:WaitForChild('leaderstats')
	local isit = sta:WaitForChild('TotalDrinks')
	local char = game.Workspace:FindFirstChild(playerr.Name)
	if char then
		char.Humanoid.JumpPower = char.Humanoid.JumpPower*isit.Value/10+3-.4+1-.6
		--[[		if char.Humanoid.JumpPower >= 300 then
			char.Humanoid.JumpPower = 300
			print("Child found, JumpPower was above 300. Ressurected back to 300. Located in OnServerEvent")
		end]]
	end
end)
1 Like