We need to see your new code, please. If you used math.min
and never changed MaxHealth, this should not happen.
local db = false
script.Parent.Touched:Connect(function(part)
local humanoid
if part.Parent.Humanoid then
humanoid = part.Parent.Humanoid
elseif part.Parent.Parent.Humanoid then
humanoid = part.Parent.Parent.Humanoid
end
if humanoid ~= nil and db == false then
db = true
humanoid.Health = math.min(humanoid.Health + 50, humanoid.MaxHealth)
script.Parent.Parent:Destroy()
wait(1)
db = false
end
end)
Iāve also tried to do it like this as well
Other code
local db = false
script.Parent.Touched:Connect(function(part)
local humanoid
if part.Parent.Humanoid then
humanoid = part.Parent.Humanoid
elseif part.Parent.Parent.Humanoid then
humanoid = part.Parent.Parent.Humanoid
end
if humanoid ~= nil and db == false then
db = true
if humanoid.Health <= 99 then
humanoid.Health = math.min(humanoid.Health + 50, humanoid.MaxHealth)
script.Parent.Parent:Destroy()
end
wait(1)
db = false
end
end)
Of course I donāt think this would do that much.
Also hereās a visual demonstration.
Are you absolutely positive you applied the script changes?
Are there any other scripts in your game that also affect the humanoidās health?
This is just a plain baseplate. This also isnāt in team create so Iām pretty sure you donāt have to apply changes with a said ābuttonā I guess
I tried the script in an empty game with a dummy part and it works perfectly, with the exception of the line script.Parent.Parent:Destroy()
, but you probably used that to destroy the parent model.
Bottom line is the script works by itself, so the problem is somewhere else.
Iāll give it a try in another game, just in case if thereās a random script somewhere I canāt see for some reason.
Yeah, I tested it in a clean test server, no extra scripts or anything. It did the same thing. I also tested this with just one health pad and not using 2 and set my health to something like 70 and it still resulted in the same thing.
yeah this worked, super odd, I even put it into my actual model and it still works. I really donāt know what was wrong.
Maybe the script changes were not applied, or were not duplicated across the models. Does it work now?
It does work now. very odd.
30