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

Scripts Work In Solo but not Online?

Asked by 8 years ago

Ok so, I am making glass that breaks when you shoot it to damage it at all. It works perfectly is Studio but not Online anyone got an idea why?

Script 1 Inside Glass Model

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 Also Inside Glass Model.

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********

When I load this up In a Online Server and Shoot it or Use a Melee on it I can not damage it at all. Please help, Thank you. Btw I already tried the Blog Post "It works in Studio, but not online!" Thats where the :WaitForChild("Humanoid") came in.

1 answer

Log in to vote
0
Answered by 8 years ago

https://scriptinghelpers.org/blog/it-works-in-studio-but-not-online

:D

0
USArmy I already tried that if you did not read my question ShadowShocks 42 — 8y
Ad

Answer this question