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
MAY HAVE FIXED IT
NVM
ok so i have to get rid rid of parenthesis in front of calling click