I have been working on making my first gun and just about finished everything. However it doesn’t work with FE so if I shoot another player they don’t lose any health but on my screen it looks like I took health away. Does anyone know a good tutorial on how I could fix this.
It sounds like you’re running everything in a local script. you need things on the server to tell it what to do.
so on the client, instead of doing the line where you damage their humanoid. have a line that fires an event on the server with some kind of data that i can reconstruct the ray, such as your mouse’s CFrame Position.
On the server side you listen for that event to be fired, refire the ray using the player and the mouse position, and then do the damage.
I’m no where near a computer to write up some code for you, but i hope that this at least kind of answers your question, and gives you some code theory into how to fix it
So in Roblox, there is client and server. In old days, a lot of games didn’t use filtering enabled back then everything you do automatically would get replicated to the server(basically all players see it), but exploiters used this vulnerability to make things that don’t really exist and then Roblox made filtering enabled which nothing but only some things like your character gets replicated. And if you want to do something that replicates you have to use remote events just make one at replicated storage and make a script in serverscriptservice and put this:
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(sender, plr, dmg)
game.Players[plr.Name].Character.Humanoid:TakeDamage(dmg)
end)
Yes, I know Its literally exploitable, but you can fix it yourself. Then into your gun script find the part where it damages the player
and add this code:
game.ReplicatedStorage.RemoteEvent:FireServer(put the player to damage here, put the damage to dealt here)