Hello community! I have a good question for you. If I put a ModuleScripts in StarterPlayerScripts or others client storage can I use this as LocalScript?

Example, this is possible in a ModuleScript put in a client storage?

--< Services
local PlayerService = game:GetService('Players')

--< Variables
local Player = PlayerService.LocalPlayer

Can I find the client with my ModuleScript or the ModuleScript is as ServerScript? So thank you for answers and have a good day!

3 comments

2

Your question's title is not formatted correctly. I think you mean "Can I use LocalPlayer in a ModuleScript?" The answer is yes. As long as the module is required client side it won't be an issue. Module scripts will run in the environment they are required in. If the module is required server side, LocalPlayer will be nil. Required client side, it will be fine.

1

Sorry but I don't good speak english. I'm originally speak french and i'm actually learn english. So thank you for your answer is appreciate:))

0

No problem and thanks for the upvote. It helps a lot