Making a gun without using localscripts

In order to make my game harder to exploit, I am taking lots of preventive measures, specifically in my gun script. However, before I begin, I first want to know if the easiest and most practical solution is possible; making a gun without using localscripts, and, therefore, with no risk of exploits. Any help is appreciated.

2 Likes

Hi there.

Maybe check out some YouTube videos? Might be some programmers that respond soon, as I only Build and do Roblox Terrain.

Enjoy your xmas, and have a happy new year.

1 Like

i don think its possible to make guns without local sccripting

I might be wrong but that sounds nearly impossible since you need to grab the inputs of the player.

Another thing is that it’d just be painful to try and script your way around it. Don’t hurt your game development by trying to find tricks to make it harder to exploit when exploiters can just do a 180 and exploit it easily.

Of course, dont be wreckless and handle the entire system on local scripts-

2 Likes

After a little thinking, I am pretty sure you’re not able to do this without localscripts.

Unless you are trying to do this for a challenge, don’t. It is not possible to make a gun without client code. However, you can do this without making any new client code by tapping into something that is already sent from the client to server. For example, you could make multiple tools and use the equipped function on a server script. Activate the “Equip” tool to add/remove the gun model to your character. Fire tool to fire the gun, reload tool to reload. There are many other ways to do this as well.

You want to have both the server and the client to make the best possible gun. With just the server, there would be a small delay equal to 2x the ping before you can see the response to your action. You can give an immediate response to the user through the local script and verify their actions and replicate on the server. This way you have both responsiveness of pre filtering enabled and the anti hack/lag kill of post.

If you have filtering enable, the server will not replicate anything that originates from the client. Hackers can still inject client code but it wont do anything except to things they have control over(their character). Same goes for any local scripts you create. Only worry about how you use remote events, and don’t trust the client. Lets say you have the client keep track of the reload time and fire a remote that fires the gun. The client also provides the origin and direction. A hacker could use that remote and spam it with bullets aimed perfectly at everyone in the game. To avoid this, do critical calculations on the server, sometimes in parallel with the client.

First, you can’t. Second, have server side denounces.

Without using any LocalScripts, the input experience is extremely poor, from what I remember back then when I was scripting a weapon. It turns out that the architecture requires a LocalScript to handle the inputs while the server processes sanity checks. The only problem that server-only handling has is its immense delay, that poses a poor user experience.

Minimal delay requires a “double replication” where the clients are handling the visuals, while the server is verifying its hits and other things.

You need to use local scripts to get the mouse and fire a remote every time player clicks but to make the game inexploitable you must do the shooting, cooldown or fire rate or damaging from server.

So if you only use client to fire a remote every click you wont have any issues with exploits but dont do anything about shooting o client just the click part

Basically if you only use the client for input they wont be able to exploit

Whatever they do it will still be totally impossible to exploit this script

1 Like