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

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

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

✓ Accepted answer

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 comment

1

All though it didn't fix all of my problems There still some massive problems but I can try to fix'em

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