Replicated Storage Server Script Service and Starter Player Scripts Help

How do I put stuff like Replicated Storage, Server Script Service and Starter Player Scripts in a module to make them function for gear?

1 Like

What do you mean with ‘put in a module’? You mean use inside a module?

I have no idea what you’re asking. If you mean you want to use these services in a module script, you can get the services with game:GetService()

--We can get services with GetService()
local replicatedStorage = game:GetService("ReplicatedStorage")
local serverScriptService = game:GetService("ServerScriptService")

--Because StarterPlayerScripts isn't a service, we have to get the StarterPlayer service, and get it from there
local starterPlayer = game:GetService("StarterPlayer")
local starterPlayerScripts = starterPlayer:WaitForChild("StarterPlayerScripts")

Just note that contents changed in StarterPlayerScripts won’t affect the client at run time. You have to instead get the PlayerScripts object on the player.

Cool Creations is for showcasing works, not for help. Please read category guidelines before posting. I have recategorised this accordingly to a place where you can get code help.

Please do specify as to what exactly you are asking, it is quite confusing. I will help you after you elaborate, thanks!

I think I understand what you’re asking;

You may correct me if I’m wrong but you’re asking: How do I use ReplicatedStorage, ServerScriptService & StarterPlayerScripts in a module script and have them function in a gear?;
If this is the case, you can use the :GetService() function to use these inside a module.

Here’s @GalaxyGourmet’s script that they posted:

--We can get services with GetService()
local replicatedStorage = game:GetService("ReplicatedStorage")
local serverScriptService = game:GetService("ServerScriptService")

--Because StarterPlayerScripts isn't a service, we have to get the StarterPlayer service, and get it from there
local starterPlayer = game:GetService("StarterPlayer")
local starterPlayerScripts = starterPlayer:WaitForChild("StarterPlayerScripts")

I must also aware you that if one thing messes up in a module; the rest of the module could break so you need to make sure everything in your module works before attempting to use it. Keep that in mind.

Yeah, this is what I am asking for, sorry for mixing categories, I don’t know how to use Dev Forum but I am using it more,

I want 2 gears in my module that need ReplicatedStorage, ServerScriptService and StarterPlayerScripts but how do I make them function in the module script?

This is what I mean, sorry if it’s confusing.

My mistake, I am just using Dev Forum more now.