#Jumped Error

1 messages · Page 1 of 1 (latest)

slim edge
#

Im new to lua and im trying to make it so that every time you jump it adds to the total power of it and Ive got this error and no idea how to solve it.

thorn zenith
#

i dont know if its correct or not

#

but functions

#

are not like that

thorn zenith
slim edge
#

still

#

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)

player.CharacterAdded:Connect(function(character)
    
    local Humanoid = character:WaitForChild("Humanoid")
    Humanoid.JumpPower = 50
    Humanoid.Jumped:Connect(function(Active)
        if Active then 
            Humanoid.JumpPower = Humanoid.JumpPower + 1
        end
    end)
end)

end)

#

this is it after your editting

thorn zenith
#

ok wait

slim edge
#

is it cause it doesnt exist in the server

thorn zenith
#

is it a localscript or script

slim edge
#

script

#

server sided

thorn zenith
#

okay

thorn zenith
# slim edge script

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local Humanoid = character:WaitForChild("Humanoid")
Humanoid.JumpPower = 50

    Humanoid.Jumped:Connect(function()
        Humanoid.JumpPower = Humanoid.JumpPower + 1
    end)
end)

end)

ok try this

#

tell me if it works

thorn zenith
#

im gonna try an alternative approach

visual onyx
thorn zenith
#

ill see if it fixes the problem

slim edge
stuck surgeBOT
#

studio** You are now Level 1! **studio

thorn zenith
# slim edge same error

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local Humanoid = character:WaitForChild("Humanoid")
Humanoid.JumpPower = 50

    Humanoid.StateChanged:Connect(function(oldState, newState)
        if newState == Enum.HumanoidStateType.Jumping then
            Humanoid.JumpPower += 1
        end
    end)
end)

end)

#

try this

#

ive tried a diff approach

#

also put in serverscriptservice as a script btw

#

if it dosent work ill add debugging prints

visual onyx
#

i do smth like thats
local Players = game:GetService("Players")
local jumped = false
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local Humanoid = character:WaitForChild("Humanoid")
Humanoid.JumpHeight = 50
a(Humanoid)

end)

end)
function a(Humanoid)
while true do
if Humanoid.Jump == true and jumped == false then
Humanoid.JumpHeight = Humanoid.JumpHeight + 1
jumped = true
end
if Humanoid.Jump == false and jumped == true then
jumped = false
end
task.wait(0.1)
end
end

#

i tried it work but maybe not like you need

stuck surgeBOT
#

studio** You are now Level 6! **studio

thorn zenith
#

@slim edge

#

@slim edge