Attempt to connect failed: Passed value is not a function?
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)
01 | script.Parent.MouseEnter:connect( function () |
02 | script.Parent:TweenPosition(UDim 2. new( 0 , 0 , 0.3 , 0 ), "Out" , "Quad" , 0.1 ) |
03 | script.Parent.Parent.Parent.MouseOver:Play() |
06 | script.Parent.MouseLeave:connect( function () |
07 | script.Parent:TweenPosition(UDim 2. new( 0 ,- 20 , 0.3 , 0 ), "Out" , "Quad" , 0.1 ) |
14 | script.Parent.MouseButton 1 Click:connect( function () |
16 | script.Parent.Parent.Parent.MouseClick:Play() |
17 | if script.Parent.Selected = = false then |
18 | script.Parent.Selected = true |
19 | script.Parent.Parent.Style.Visible = true |
20 | for i,v in ipairs (Game.Players:GetChildren()) do |
21 | if v.Name ~ = game.Players.LocalPlayer.Name then |
22 | table.insert(players,v) |
25 | script.Parent.Parent.Style.Forward.MouseButton 1 Click:connect(GoForward) |
26 | script.Parent.Parent.Style.Back.MouseButton 1 Click:connect(GoBack) |
28 | script.Parent.Selected = false |
29 | script.Parent.Parent.Style.Visible = false |
30 | game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid |
35 | if game.Players.NumPlayers = = 1 then |
36 | script.Parent:TweenPosition(UDim 2. new( 0 ,- 150 , 0.3 , 0 ), "In" , "Quad" , 0.5 ) |
38 | script.Parent:TweenPosition(UDim 2. new( 0 ,- 15 , 0.3 , 0 ), "Out" , "Quad" , 0.5 ) |
45 | if PChoice > = #players then |
48 | game.Workspace.CurrentCamera.CameraSubject = players [ PChoice ] .Character.Humanoid |
56 | game.Workspace.CurrentCamera.CameraSubject = players [ PChoice ] .Character.Humanoid |
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