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.
https://scriptinghelpers.org/blog/it-works-in-studio-but-not-online
:D