Need help with value

  1. What I want to achieve?
    I want that that player jump is updated with DuringGameJumpMulti.Value

  2. What is the issue?

humanoid.JumpPower = humanoid.JumpPower + DuringGameJumpMulti.Value

DuringGameJumpMulti.Value is updating when i go to workspace and player it is updated but still it is not add up to humanoid.JumpPower

–local script

local rs = game:GetService("ReplicatedStorage")
local MWVF = rs:WaitForChild("MatchWorkingValues")
local S = MWVF:WaitForChild("START")
local E = MWVF:WaitForChild("END")
local gmframe = script.Parent:WaitForChild("gmframe")
local g = gmframe.GRAVITY["GRAVITY ICON"]
local s = gmframe.SPEED["SPEED ICON"]
local j = gmframe.JUMP["JUMP ICON"]

local p = game.Players.LocalPlayer
local leaderboard = p.leaderstats
local reqvalue = 100
local DuringGameJumpMulti = p.Character:WaitForChild("DuringGameJumpMulti")
local pgui = p.PlayerGui
local upicon = pgui["Menu gui"]["Upgrade icon"]
	
upicon.MouseButton1Up:Connect(function()
    gmframe.Visible = not gmframe.Visible
end)

j.MouseButton1Up:Connect(function()
    if p.Character then
        DuringGameJumpMulti = p.Character:FindFirstChild("DuringGameJumpMulti")
        if leaderboard and DuringGameJumpMulti then
            local e = leaderboard:FindFirstChild("Energy")
            if e.Value >= reqvalue then
                e.Value = e.Value - reqvalue
                reqvalue = reqvalue + 100
                DuringGameJumpMulti.Value = DuringGameJumpMulti.Value + 100
            end
        end
    end
end)

main script

for c10S = 300, 0, -1 do
			task.wait(1)
			status.Value = "Game END IN "..tostring(c10S)

			for i, p in pairs(game.Players:GetPlayers()) do
				local character = p.Character
				if character then
					DuringGameJumpMulti = character:FindFirstChild("DuringGameJumpMulti")
					if DuringGameJumpMulti and character:FindFirstChild("Humanoid") then
						local humanoid = character:FindFirstChild("Humanoid")
						humanoid.JumpPower = humanoid.JumpPower + DuringGameJumpMulti.Value
						humanoid.WalkSpeed = humanoid.WalkSpeed + 0.5 
					end
				end
			end
		end
			

full main script

local rs = game:GetService("ReplicatedStorage")



local status = rs:WaitForChild("STATUS")
local MWVF = rs:WaitForChild("MatchWorkingValues")
local S = MWVF:WaitForChild("START")
local E = MWVF:WaitForChild("END")

local reseter = require(script["RL Module"])
local resetingpperk = require(script["RDGP Module"])
local PrePerk = require(script.PreGModule)

local Players = game:GetService("Players")
local TargetPart = game.Workspace.respawningpoint



local WB = rs:WaitForChild("Winningbools")

local first = WB:WaitForChild("1st")
local second = WB:WaitForChild("2nd")
local third = WB:WaitForChild("3rd")
local forth = WB:WaitForChild("4th")
local fifth = WB:WaitForChild("5th")
local part = game.Workspace["wining point"].WinPad.WinGiver
local given = {}
local Players = game:GetService("Players")
local rs = game:GetService("ReplicatedStorage")




part.Touched:Connect(function(hit)
	local player = game.Players:GetPlayerFromCharacter(hit.Parent)
	if player and not table.find(given, player) then
		table.insert(given, player)
		print(player.Name .. " has touched the part")

		local character = player.Character
		if character then
			local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
			if humanoidRootPart then
				humanoidRootPart.CFrame = TargetPart.CFrame
				if not (first.Value == true)  then
					first.Value = true
					player.leaderstats.CGR.Value = player.leaderstats.CGR.Value + 150
				elseif not (second.Value == true) then
					second.Value = true
					player.leaderstats.CGR.Value = player.leaderstats.CGR.Value + 125
				elseif not (third.Value == true) then
					third.Value = true
					player.leaderstats.CGR.Value = player.leaderstats.CGR.Value + 100
				elseif not (forth.Value == true) then
					forth.Value = true
					player.leaderstats.CGR.Value = player.leaderstats.CGR.Value + 75
				elseif not (fifth.Value == true) then
					fifth.Value = true
					player.leaderstats.CGR.Value = player.leaderstats.CGR.Value + 50

				end
			end
			
		end
	end
end)



-- Listen for the PlayerRemoving event of each player in the given table
for _, player in ipairs(given) do
	player.CharacterRemoving:Connect(function()
		table.remove(given, table.find(given, player))
	end)
end
while task.wait() do
	repeat task.wait() until game.Players.NumPlayers >=1
	status.Value = "match Starting soon"
	if E.Value == true or S.Value == false then
		
		E.Value = false
		S.Value = true
		
		task.wait(1)
		for c102N = 0,10,1 do
			task.wait(1)
			
			status.Value = "GAME START IN "..tostring(c102N)
		end
		resetingpperk.resetPower()
		status.Value = "RUN OR JUMP OR GRIND"
		task.wait(1)
		status.Value = "IDK!"
		for _, player in ipairs(Players:GetPlayers()) do
			local character = player.Character
			if character then
				local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
				if humanoidRootPart then
					humanoidRootPart.CFrame = TargetPart.CFrame
				end
			end
		end
		-- main game 
		for c10S = 300, 0, -1 do
			task.wait(1)
			status.Value = "Game END IN "..tostring(c10S)

			for i, p in pairs(game.Players:GetPlayers()) do
				local character = p.Character
				if character then
					DuringGameJumpMulti = character:FindFirstChild("DuringGameJumpMulti")
					if DuringGameJumpMulti and character:FindFirstChild("Humanoid") then
						local humanoid = character:FindFirstChild("Humanoid")
						humanoid.JumpPower = humanoid.JumpPower + DuringGameJumpMulti.Value
						humanoid.WalkSpeed = humanoid.WalkSpeed + 0.5 
					end
				end
			end
		end
			
		if E.Value == false and S.Value == true then
			print("esworking")
			S.Value = false
			E.Value = true
			reseter.resetLeaderboard()
			task.wait()
			
			PrePerk.PrePower()
			
			 -- replace "TargetPart" with the name of your target part

			for _, player in ipairs(Players:GetPlayers()) do
				local character = player.Character
				if character then
					local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
					if humanoidRootPart then
						humanoidRootPart.CFrame = TargetPart.CFrame
					end
				end
			end
			
			

			

			
				local playerNames = ""

				for i, player in ipairs(given) do
					playerNames = playerNames .. player.Name .. ", "
				end

				status.Value = "Winners: " .. playerNames
			task.wait(2)
			first.Value = false
			second.Value = false
			third.Value = false
			forth.Value = false
			fifth.Value = false

			
		end
	end
end
````
sorry for bad grammar I am not English
1 Like

You need use remote event because DuringGameJumpMulti.Value change only value on client
Add remote event to ReplicatedStorage and give it name ChangeGameJumpMulti.
Then use this local script instead of old one:

local rs = game:GetService("ReplicatedStorage")
local MWVF = rs:WaitForChild("MatchWorkingValues")
local S = MWVF:WaitForChild("START")
local E = MWVF:WaitForChild("END")
local gmframe = script.Parent:WaitForChild("gmframe")
local g = gmframe.GRAVITY["GRAVITY ICON"]
local s = gmframe.SPEED["SPEED ICON"]
local j = gmframe.JUMP["JUMP ICON"]

local p = game.Players.LocalPlayer
local leaderboard = p.leaderstats
local reqvalue = 100
local DuringGameJumpMulti = p.Character:WaitForChild("DuringGameJumpMulti")
local pgui = p.PlayerGui
local upicon = pgui["Menu gui"]["Upgrade icon"]
local RE = game:GetService("ReplicatedStorage"):WaitForChild("ChangeGameJumpMulti")
	
upicon.MouseButton1Up:Connect(function()
    gmframe.Visible = not gmframe.Visible
end)

j.MouseButton1Up:Connect(function()
    if p.Character then
        DuringGameJumpMulti = p.Character:FindFirstChild("DuringGameJumpMulti")
        if leaderboard and DuringGameJumpMulti then
            local e = leaderboard:FindFirstChild("Energy")
            if e.Value >= reqvalue then
                RE:FireServer(DuringGameJumpMulti,e)
                reqvalue = reqvalue + 100
            end
        end
    end
end)

Now and one basic script with this code:

local RE = game:GetService("ReplicatedStorage"):WaitForChild("ChangeGameJumpMulti")
local reqvalue = 100
RE.OnServerFired:Connect(function(player,DuringGameJumpMulti)
       local e = player:WaitForChild("leaderstats"):WaitForChild("Energy")
       if e.Value >= reqvalue then
              e.Value = e.Value - reqvalue 
               reqvalue = reqvalue + 100
               DuringGameJumpMulti.Value = DuringGameJumpMulti.Value + 100
      end
end)
1 Like

so i dont need to change anything in main script ?

Yes, you don’t need.

Thank you I was thinking to use Remote event idk why I didnot

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.