So first you would want to get the specific part that you would like to send through the remote event. Like so
1 | local part = game.Workspace:FindFirstChild( 'Part' ) |
The ends and some things might be wrong and that's because I'm typing in the textbox and I'm retarded enough to not know how to use a keyboard correctly and how ends work
Anyways, after you got the part, you're going to want to fire the event and set part
as a parameter for the remote event
1 | local part = game.Workspace:FindFirstChild( 'Part' ) |
2 | local event = game.ReplicatedStorage:WaitForChild( 'RemoteEvent' ) |
So after you have fired the remote event, you need to head on over to the other script and where you make the event to listen to when the remote event has been fired, you need to set the parameters. Whenever you fire the server, the first parameter is ALWAYS the player. If you do not put the player, the first parameter you put will be used as the player. So for example, if I put event.OnServerEvent:Connect(function(part)
, part
will be treated as the player
.
1 | local part = game.Workspace:FindFirstChild( 'Part' ) |
2 | local event = game.ReplicatedStorage:WaitForChild( 'RemoteEvent' ) |
4 | event.OnServerEvent:Connect( function (player, part) |
That's basically everything, please accept my answer if I helped you out, and if you got any other questions, I'll be happy to help you in the community chat!