Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How come my weapons are broken? [SOLVED]]

Well, the problem is that everytime I start up a Roblox Studio Server, and I use my weapons, such as a LinkedSword, the weapons does damage to the player, but it doesn't kill him. What I mean is that after doing damage, for example, Player 2 attacks Player1 and does 10 damage, the Player1's health is instantly regenerated, causing Player1 to not die. If anyone can give me help, I would appreciate it.

The problem was me adding some Values in it. After I removed it from the server the weapons magically worked again. Thanks to 1waffle1 and RandomGuyTho for helping me and giving me suggestions.

4 comments

0

Maybe it's a script. Try posting a script.

0

The sword is not doing that. Try again.

0

The most likely cause of what is happening is that something is explicitly causing exactly that to happen. There could be some script running that is preventing death. I could write one.

0

Well, if you can do this, I would be really happy to see it and learn from it.

1 answer

From the looks of what I have read, it has become clear to me that you are saying that your sword works but the health regenerates after a player takes damage. If I am correct then here is the reason and how to fix it including an example.

The reason of health regeneration is that when a Character loads, a "Health" script used to regenerate a Humanoid's Heath comes within it.

In order to change this, you would have to get to a player's character and remove the "Health" script. This can be done in various ways but below is a script that assures that when a player is added, the health script inside their character is removed so that they cannot regenerate health after taking damage.

Example Code: (This should be in a LocalScript placed in the Starter Pack.)

local player = script.Parent.Parent

player.Character.ChildAdded:connect(function(child)
	repeat wait() until player.Character
	if child.Name == "Health" and child:IsA("Script") then
		child:remove()
	end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.