Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is my script not working?

Asked by 8 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

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.

0
At what point does the script take damage from the humanoid? M39a9am3R 3210 — 8y
0
When a Player uses a weapon on it. ShadowShocks 42 — 8y
0
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 ShadowShocks 42 — 8y

Answer this question