Where Should I Put My Script In Order For It to Run and Be Recognized by a LocalScript?

Ok! It worked, which means that the problem has been solved. Thank you all for your work, and I hope you guys have a good day. :smile:

2 Likes

No worries! Happy to help, if you know how, please mark the solution to help others!

1 Like

One more question, though. How do I get their name? LocalPlayer won’t work for me, so I don’t know what to do in order to get the player’s name.

Lets say you fire the event like xyz:FireServer(arg1, arg2), so the OnServerEvent would look like this:

xyz.OnServerEvent:Connect(function(player, arg1, arg2) -- the first argument is ALWAYS the player, even if you don't need it

--"player" is the player (client) that fired this event
--you can use "player" the same way
--so their name would be player.Name

end)

So the first argument is player, and then come the other you want to send. In your case, you don’t send anything, so you can just say function(player) and then use player however you like.

Please read this documentation to learn more about RemoteEvents and RemoteFunctions:

1 Like

Would I need arg1 to be the player, or is it there by default?

It’s there by default, you don’t need anything. You only need arg1 if you want to send something else too.

2 Likes

Alright, thanks for the help! :smiley: