Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago

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())
0
MAY HAVE FIXED IT rookiecookie153 53 — 4y
0
NVM rookiecookie153 53 — 4y
0
ok so i have to get rid rid of parenthesis in front of calling click rookiecookie153 53 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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

Ad

Answer this question