Answered by
7 years ago Edited 7 years ago
(This answer only applies if you have FilteringEnabled on; you can check it by looking in the Properties window with the Workspace selected.)
The default behaviour is for the player to die when their health reaches 0. Assuming you haven't changed that (and haven't changed the health system and haven't changed the player's default model), then what you're describing is what one would expect if your weapons you're using were not designed for FilteringEnabled -- that is, they attempt to hurt the player's Health directly. This causes their health drain to be only visible to you. To fix this, you have to have the server run the health drain code instead of the client. A very insecure method is to have a RemoteEvent that lets any client tell the server who they hit and how much damage they caused. Do note that scripting it like this is the easiest route, with the drawback that any exploiter will be able to kill everyone else in the server instantly and repeatedly (though you can add checks to limit this, if you know how). An even more insecure method is to disable FilteringEnabled (granting exploiters free reign), but at least your game would be playable if you just invite a few trusted friends into it.
Edit: Here's the insecure method. In every weapon, find where it damages the player and instead fire a RemoteEvent that you have placed in game.ReplicatedStorage named "DamagePlayer"
04 | hum.Health = hum.Health - 5 |
06 | game.ReplicatedStorage.DamagePlayer:FireServer(hum, 5 ) |
09 | game.ReplicatedStorage.DamagePlayer.OnServerEvent:Connect( function (player, humanoid, damage) |
10 | if not humanoid then return end |
11 | if type (damage) ~ = "number" or damage < 0 or damage > 100 then return end |
14 | humanoid:TakeDamage(damage) |
A superior method (requires more scripting skills) is the client telling the server the weapon used and the angle it was fired at; the server can then determine if any damage should be applied to anyone. Note that this is still weak to aim-bots, but at least exploiters wouldn't be able to kill people through walls.