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

attempt to index a nil value?

Hello, I'm Making a JoJo game and I stumbled upon an error: 14:55:27.481 - Players.MajinBluee.Backpack.None:711: attempt to index a nil value. I don't really have much to say.

Script (LocalScript):

InputService.InputBegan:connect(function(input)
	if workspace.timestopped.Value == false or workspace.timestopper.Value == Player.Name then
		if input.UserInputType == Enum.UserInputType.MouseButton1 and not intextbox and PlayerGui:WaitForChild("statUI"):FindFirstChild("background").Position ~= UDim2.new(0.7,0,0.06,0) then
--....

The Problem is in line 3.

Help Would Be Really Appreciated

2 answers

I'm assuming the issue is coming from the intextbox variable it's checking. If so, remove that part and simply post this right beneath the input check.

local TBF = game:GetService("UserInputService"):GetFocusedTextBox()
if TBF then return end

Not 100% sure if that's where the error is coming in at but that's my rough guess. Hope this helps.

3 comments

0

Nope. Doesn't Work.

0

I think I fixed it, Thanks for the help!

0

Np. Glad you managed to work it out.

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