I am trying to make a boat that uses remote events to communicate with the server script. When I tried this:
1 | local seat = nil |
2 | seat.Changed:connect( function () |
3 |
4 | MoveEvent = seat.RemoteEvent |
5 | end ) |
it gave this error: 10:00:02.427 - Players.Player.PlayerScripts.LocalScript:37: attempt to index local 'seat' (a nil value) notes: I can't just define a variable for that seat. I need it to work with any boat
If you mean you want this variable accessible from all serverscripts, then you must assign a global variable. So you would do this: _G.seat = nil