Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why isnt jumppower working when executed?

jumppower is in line 69 - 84

local commands = {}

local prefix = "/"

local admins = {
	"GamerOx_23"
}

local function findPlayer(name)
    for i, player in pairs(game.Players:GetPlayers()) do
        if string.lower(player.Name) == name then
            return player
        end
    end

    return nil
end

local function isAdmin(player)
	for _, v in pairs(admins) do
		if v == player.Name then
			return true else
			return false
		end
	end

end

commands.tp = function(sender, arguments)
    print("TP Function fired by" .. sender.Name)

    for i, playerName in pairs(arguments) do
        print(playerName)
    end

    local playerToTeleportName = arguments[1]
    local playerToTeleportToName = arguments[2]

    if playerToTeleportName and playerToTeleportName then
        local plrToTP = findPlayer(playerToTeleportName)
        local plrToTpTo = findPlayer(playerToTeleportName)

        if plrToTP and plrToTpTo then
            plrToTP.Character:WaitForChild("HumanoidRootPart").CFrame =
                plrToTpTo.Character:WaitForChild("HumanoidRootPart").CFrame
            print("It fricking worked")
        end
    end
end

commands.speed = function(sender, arguments) --"/speed me 30" ---> arguments["me","30"]
	
	print("Speed command fired by "..sender.Name)
	
	local playerToGiveSpeedTo = arguments[1]
	local amountOfSpeedToGive = arguments[2]
	
	
	if playerToGiveSpeedTo then
		local plr = findPlayer(playerToGiveSpeedTo)
		
		if plr then
			plr.Character.Humanoid.WalkSpeed = tonumber(amountOfSpeedToGive)
			print(playerToGiveSpeedTo.." was given Walkspeed".. amountOfSpeedToGive)
		end	
	end
end

commands.jumpPower = function(sender,arguments)
	
	print("jumppower fired by".. sender)
	
	local playerToGiveJumpTo = arguments[1]
	local amountOfJumpToGive = arguments[2]
	
	if playerToGiveJumpTo then
		local plr = findPlayer(playerToGiveJumpTo)
		
		if plr then
			plr.Character.Humanoid.JumpPower = tonumber(amountOfJumpToGive)
			print(playerToGiveJumpTo.." was given jumpPower".. amountOfJumpToGive)
		end
	end
end

game.Players.PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(message, recipient)
		if isAdmin(player) then	
		message = string.lower(message)

        local splitString = message:split(" ")

        local slashCommand = splitString[1]

        local cmd = slashCommand:split(prefix)

        local cmdName = cmd[2]

        if commands[cmdName] then
			local arguments = {}

            for i = 2, #splitString, 1 do
                        table.insert(arguments, splitString[i])
            end

			 commands[cmdName](player,arguments)
			
		end

			end
		end)
    end)

1 answer

replace line 80 with this

local Humanoid = plr.Character:waitforchild("Humanoid")
humanoid.jumppower = (Add Amount Here)

This discussion is preserved as it was. New answers, comments, and votes are closed.