So whenever i run the game on studio it says:
1 | 15 : 32 : 57.254 - Attempt to connect failed: Passed value is not a function |
I have looked online and people have been saying it has to be Before the connect, Which in my case it is. Here is the code:
01 | function Refresh() |
02 |
03 | for i,v in pairs (Items) do |
04 |
05 | if v.Length < 1 then |
06 | print ( "Test" ) |
07 | end |
08 |
09 | end |
10 |
11 |
12 | end |
13 |
14 | Slots [ 1 ] .MouseButton 1 Down:Connect(Refresh()) |
I'm not entirely sure what this script is suppose to be doing other than printing something but try adding a wait(0.5) command. Like this..
01 | function Refresh() |
02 |
03 | for i,v in pairs (Items) do |
04 |
05 | if v.Length < 1 then |
06 | print ( "Test" ) |
07 | wait( 0.5 ) |
08 | end |
09 |
10 | end |
11 |
12 |
13 | end |
14 |
15 | Slots [ 1 ] .MouseButton 1 Down:Connect(Refresh()) |
Hello! Looking at the script made me think that Slots[1].MouseButton1Down:Connect(Refresh())
is wrong. I think it should be Slots[1].MouseButton1Down:Connect(Refresh)
Finished code:
01 | function Refresh() |
02 |
03 | for i,v in pairs (Items) do |
04 |
05 | if v.Length < 1 then |
06 | print ( "Test" ) |
07 | end |
08 |
09 | end |
10 |
11 |
12 | end |
13 |
14 | Slots [ 1 ] .MouseButton 1 Down:Connect(Refresh) |
Hope this helps!