LocalPlayer ScreenUI Error "attemp to index nil with leaderstats"

That should work perfectly without any issues.

1 Like

It’s like every fix makes a new issue, now the detectors won’t work when the ball hits

script.Parent.Touched:Connect(function(h)
	if h:IsA("Part") and h.Name == "PlinkoBall" then
		print('1.0x Triggered')
		wait(0.2)
		local outcome = h.Value.Value * 1.0
		print(outcome)
		h:Destroy()
	end
end)

image

1 Like

Any ideas on what can be causing it to mess up? ^

1 Like

is that a client sided script or a server sided script?

1 Like

It was working as a client but then it stopped so i tried local but neither work now.

1 Like

Are there any errors in the console?

1 Like

image

1 Like

Well, there you go, now you can fix it.

1 Like

I don’t understand what Requested module was required recursively means.

1 Like

I don’t have any module scripts

1 Like

Lets say we have two module scripts, script A and script B.

In script A, you require script B and in script B, you require script A. This causes it to infinitely require each other which causes that error.

1 Like

I only have client and local scripts though, no module scripts

1 Like

Can you show me the line thats causing the error?

1 Like

It doesn’t show me any line number

1 Like

image
show me whats after that

1 Like


Nothing is after it

1 Like

Seems like the error is originating from one of the plugins you have installed, it has nothing to do with the script.

1 Like

Hm alright, but that doesn’t explain why the ball detector / destroyer stopped working

1 Like
script.Parent.Touched:Connect(function(h)
	if h:IsA("Part") and h.Name == "PlinkoBall" then
		print('1.0x Triggered')
		wait(0.2)
		local outcome = h.Value.Value * 1.0
		print(outcome)
		h:Destroy()
	end
end)

any errors in the output here? (except the module spam, this is from some plugin you installed from the library )

1 Like

More info here: Part won't destroy on detection

But no there is 0 errors

1 Like