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

"Attempt to connect failed: Passed value is not a function" any help?

whenever i run this script, at line 30 i get this error. 20:03:48.092 - Attempt to connect failed: Passed value is not a function

here is my code:

local Particle1Emitter = script.Parent.ParticleEmitter1Part
local Particle2Emitter = script.Parent.ParticleEmitter2Part
local Particle3Emitter = script.Parent.ParticleEmitter3Part
local Particle4Emitter = script.Parent.ParticleEmitter4Part
local Light = script.Parent.PointLight

local GreenButtonClicker = script.Parent.Parent.PartGreen.ClickDetector
local OnOffBool = true

local function click()
		if OnOffBool == true then
		OnOffBool = false
		print(OnOffBool)
		Particle1Emitter.Enabled = false
		Particle2Emitter.Enabled = false
		Particle3Emitter.Enabled = false
		Particle4Emitter.Enabled = false
		Light.Enabled = false
	elseif OnOffBool == false then
		OnOffBool = true
		print(OnOffBool)
		Particle1Emitter.Enabled = true
		Particle2Emitter.Enabled = true
		Particle3Emitter.Enabled = true
		Particle4Emitter.Enabled = true
		Light.Enabled = true
	end	
end
wait(5)
GreenButtonClicker.MouseClick:Connect(click())

3 comments

0

MAY HAVE FIXED IT

0

NVM

0

ok so i have to get rid rid of parenthesis in front of calling click

1 answer

ok so for other peeps, you have to get rid of parenthesis in front of calling click

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