How to alter ReplicatedStorage from a LocalScript

Hey, thanks for looking at this post!

I need help with how to alter ReplicatedStorage from a LocalScript
I want to add RemoteEvent Instances to the ReplicatedStorage from a LocalScript and have it replicate to the server and other clients
How can I do this?

1 Like

Unfortunately, this is not possible unless you have an already existing remote event and connect that to the server.

If this was possible, most games would be damaged a lot by hackers.

LocalScripts only add instances to the client, so there is no way of adding new ones from a LocalScript. Try making a separate RemoteEvent to a server script that will then create your RemoteEvents which will then be replicated between the server and all clients.

Although you can connect remote events, hackers would take advantage of the remote event to gain control of the server.

Thanks for the quick reply but I actually found the solution (don’t worry, I’m not dealing with any sensitive information, I’m just making certain sound effects play)
I just need to make events from a ServerScript and fire them from a LocalScript

You’re not able to really protect your RemoteEvents, you will need to add server prevention methods, such as verification if statements ect, lets act as if I am a player, and I am attempting to redeem an item, or purchase an egg, I would create some form of value or something on the server that I would tick whilst the egg unboxing is occuring, then wait a second or two ( till the clients’ egg animation is over, we have to time it in a sense ), but essentially add a form of cooldown on the server, so the client isn’t able to spam the remote and buy a bunch of eggs, this is just an example, but take it as you wish. It’s best to use proper methods when creating a server and client, to prevent exploiters from hitting a remote and taking advantage of it.

I understand that exploiters can fire RemoteEvents if they’re in ReplicatedStorage if they find them but exploiters won’t be able to do anything other than spam a sound effect if they get their hands on it

Honestly, I’d love for that to happen, sounds hilarious. (imo)

But in general, I agree with you about firing events and such

If the exploiter spams the RemoteEvent prompting a server sided sound effect to be spammed, this can cause a loss in players, and upset them.

To give some context, I’ll tell you what the script does:
I created a gun tool (it’s a prop and does no damage) for a game and I made it play a sound whenever it’s fired
There is a lot of complicated (maybe badly written because I am still learning Luau) code that deals with playing animations (reloads, firing, etc.) and my sound effect is the fire sound. It is relatively quiet and since it usually fires fast anyway, I don’t think anybody would be bothered even if it was spammed up to 900 times per minute (because that’s how many rounds an M16A2 rifle shoots)

You might aswell add a feature to lower down SFX

The sound falloff is pretty high so people more than 30 studs away probably would have a hard time hearing it

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.