My Script works In Studios but Not Online for some reason? The Health loads up but you can't damage it at all. Works perfectly fine in Studios Please help. Script 1
local h = Instance.new("Humanoid")
h.Parent = script.Parent
local Human = script.Parent:WaitForChild("Humanoid")
while true do
wait(0.01)
if script.Parent:FindFirstChild("Humanoid") == true then
wait(2)
script.Parent:FindFirstChild("Humanoid").MaxHealth = 5000
wait(2)
script.Parent:FindFirstChild("Humanoid").Health = 5000
end
end
Script 2
local Destroyed = script.Parent:FindFirstChild("Humanoid")
local sound = script.Parent:FindFirstChild("Boom")
local Human = script.Parent:WaitForChild("Humanoid")
while true do
wait(0.01)
local Human = script.Parent:WaitForChild("Humanoid")
if Destroyed.Health == 0 then
sound:Play()
script.Parent:remove()
end
end
Thank you.

4 comments
At what point does the script take damage from the humanoid?
When a Player uses a weapon on it.
Once a player gets it to 0 Health it is supposed to remove itself. But it is not working In Online mode for some reason, and i see no error in dev console
Might be helpful: https://scriptinghelpers.org/blog/it-works-in-studio-but-not-online