Why Am I unable to heal after taking damage?
Asked by
5 years ago Edited 5 years ago
I'm having a hard time understanding whats happening. I made a medkit and a Damage Brick. The medkit works fine at healing on It's own, but when I take damage from the Brick I heal and It just regresses. I've spent almost 2 hours trying to find out whats wrong, any help?
Kill Brick(server script)
01 | local trapPart = script.Parent |
03 | local function onPartTouch(otherPart) |
04 | local partParent = otherPart.Parent |
05 | local humanoid = partParent:FindFirstChildWhichIsA( "Humanoid" ) |
07 | humanoid:TakeDamage( 10 ) |
11 | trapPart.Touched:Connect(onPartTouch) |
medkit(Local script)
01 | local tool = script.Parent |
02 | local player = game.Players.LocalPlayer |
03 | repeat wait() until player.character |
04 | local character = player.character |
05 | local humanoid = character.Humanoid |
09 | humanoid.Health = humanoid.Health + 30 |
13 | tool.Activated:Connect(health) |
16 | tool.Equipped:Connect( function () |
Starter Player health script(Local script)
1 | local player = game.Players.LocalPlayer |
2 | repeat wait() until player.character |
3 | character = player.character |
4 | humanoid = character.Humanoid |
The medkit ONLY stops working when you take damage from the brick.