Script Health not working

Hi, i try to set Health of my model but it’s not work, i got this error: DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key = 514878419

my script:

local model = script.Parent:FindFirstChild("Humanoid")

while wait(10) do
     if model.Health <= 1 then
          model.Health = model.MaxHealth
     end
end

I have the same script in an other model and it’s working… i don’t understand

The error you provided is unrelated to the script. You should ensure that both models have the exact same script and exact same layout.

2 Likes

Layout ? what is layout please ?

I’m talking about where the objects are in the Explorer tree. Make sure there’s a humanoid in the same model as the script.

Oh yes it’s same i have copy paste my model :confused: so i don’t understand

Are there any other errors that aren’t mentioning datastores?

No i got 0 errors just this :confused:

And it’s not a datastore request it’s just Health… so i don’t understand why i got this

This script is laid out so the humanoid’s health will be reset to 100 once it reaches 0 (with up to a 10 second delay), and I don’t really see any issues with the code. Can you show screenshots of the explorer tree containing the two models?

I have found the problem… i have multiple script with condition if health <= 1, i have make a delay in the other script and it’s working ^^

EDIT: It’s working one time of two… xD