My script is:
-- Establish the blank variables. local map local distanceToBuilding local buildingPart local morph print("Standby") wait(0.5) game.Players.PlayerAdded:Connect(function(player) wait(0.5) local debris = player:WaitForChild("leaderstats").Debris local character = player.Character print("standby") print("Map Detected!") map = workspace:WaitForChild("Map", 100) while game.ReplicatedStorage.Status.Value == "Game in progress." do for i, building in pairs(map:FindFirstChild("Buildings"):GetChildren()) do buildingPart = building:FindFirstChild("ColorParts").Floor1 or building:FindFirstChild("Leaf") print(buildingPart) distanceToBuilding = player:DistanceFromCharacter(buildingPart.Position) print(distanceToBuilding) morph = character:WaitForChild("Morph") if distanceToBuilding <= 10 then building.Health.Value = building.Health.Value - morph.Damage.Value debris.Value = debris.Value + math.random(10,20) elseif distanceToBuilding >= 10 and distanceToBuilding <= 15 then building.Health.Value = building.Health.Value - morph.Damage.Value * 0.5 debris.Value = debris.Value + math.random(5,10) elseif distanceToBuilding >= 15 and distanceToBuilding <= 20 then building.Health.Value = building.Health.Value - morph.Damage.Value * 0.1 debris.Value = debris.Value + math.random(5,10) else print("Building too far away.") end if building.Health.Value <= 0 then building:Destroy() end end wait(1) end end)
It will print Standby the first time, but then it won't do anything. Even when a map spawns, nothing happens. Help.