Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Stamina is Not working but the output doesn't specify where the problem is. Can you help me?

Asked by 3 years ago

In the output, it says that it is calling a nill value and an attempt to connect failed not a function And is causing extreme unreasonable lag

local timeyouahavebeenrunning = 0
RunService.RenderStepped:Connect(function()
    local stamina = 6

    print(timeyouahavebeenrunning)

    if Userinputservice:IsKeyDown(Enum.KeyCode.LeftShift) and humanoid.MoveDirection.Magnitude > 0 and Debounce == true then
        local Debounce = true

            if timeyouahavebeenrunning == 6 then
                local Debounce = false
            end
        RunService.RenderStepped:Connect(RunningEffect())

        humanoid.WalkSpeed = 23
        camera.FieldOfView = 80

        while Debounce == true do
            wait(1)
            timeyouahavebeenrunning = timeyouahavebeenrunning + 1
        end
    else
        local Debouce = false

            if timeyouahavebeenrunning == 0 then
                local Debounce = true
            end
        RunService.RenderStepped:Connect(updateBobbleEffect())
        humanoid.WalkSpeed = 16
        camera.FieldOfView = 70

        while Debounce == false do
            wait(1)
            timeyouahavebeenrunning = timeyouahavebeenrunning - 1

        end
    end

end)

1 answer

Log in to vote
1
Answered by
HEMAN_9 70
3 years ago

When connecting functions you exclude the parenthesis that come with the function name. Instead of ":Connect(RunningEffect())" you would say ":Connect(RunningEffect)". If you delete the set of parenthesis from right after the names of your functions you should be fine :).

1
All though it didn't fix all of my problems There still some massive problems but I can try to fix'em cool_guy5121 3 — 3y
Ad

Answer this question