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

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

Asked by 10 years ago

I was going to make a Spectate Function so you can see other players camera

I keep getting a error saying that it attempted to connect but failed because Passed Value is not a function. Thats not right because i already setup the functions.

Heres my code and the exception happend at line 25 and 26 Which is script.Parent.Parent.Style.Forward.MouseButton1Click:connect(GoForward) script.Parent.Parent.Style.Back.MouseButton1Click:connect(GoBack)

01script.Parent.MouseEnter:connect(function()
02    script.Parent:TweenPosition(UDim2.new(0,0,0.3,0),"Out","Quad",0.1)
03    script.Parent.Parent.Parent.MouseOver:Play()
04end)
05 
06script.Parent.MouseLeave:connect(function()
07    script.Parent:TweenPosition(UDim2.new(0,-20,0.3,0),"Out","Quad",0.1)
08end)
09 
10players = {}
11 
12PChoice = 1
13 
14script.Parent.MouseButton1Click:connect(function()
15    Spectating = false
View all 57 lines...

Heres the error i got

10:28:27.170 - Attempt to connect failed: Passed value is not a function 10:28:27.170 - Script 'Players.Player2.PlayerGui.Spectate.Button.System', Line 25 10:28:27.170 - Stack End 10:28:27.170 - Attempt to connect failed: Passed value is not a function 10:28:27.170 - Script 'Players.Player2.PlayerGui.Spectate.Button.System', Line 26 10:28:27.170 - Stack End

0
Please include the full code. Because you took away some of the lines of code, now we can't tell which lines are 25 and 26. Merely 2122 — 10y
0
Ok ill do it RobloxMinecraftDK 0 — 10y
0
script.Parent.Parent.Style.Forward.MouseButton1Click:connect(function() end) instead and it fixed my problem. RobloxMinecraftDK 0 — 10y

1 answer

Log in to vote
0
Answered by
Tesouro 407 Moderation Voter
10 years ago

I'm not sure, but I think the functions these lines connect are below, but they need to be above the codeblock.

0
I Just found out that it was because the function didn't initialize before calling the function. RobloxMinecraftDK 0 — 10y
0
exactly Tesouro 407 — 10y
Ad

Answer this question