|
| 16 Nov 2015 07:28 PM |
the function of this piece of code is to load a map but "shoot" lasers at parts as it loads, but for some reason it skips some parts because it thinks it's not a part, still shoots the laser, and moves on, only loading about half the map the script gives me no errors
local MapContents = game.ServerStorage.Maps[CombinedName]:GetChildren() for i = 1, #MapContents do local RandomInstance = math.random(1, #MapContents) if MapContents[RandomInstance]:IsA("BasePart") then local Target = MapContents[RandomInstance].Position local TargetPosition = (Target - Generator.GeneratorPart.Position).unit local Ray = Ray.new(Generator.GeneratorPart.Position, TargetPosition * 2047) local hit, position = workspace:FindPartOnRay(Ray) local Distance = (position - Generator.GeneratorPart.Position).magnitude local laser = Instance.new("Part", workspace) laser.Transparency = 0.5 laser.Anchored = true laser.BrickColor = BrickColor.new("Bright red") laser.TopSurface = "Smooth" laser.BottomSurface = "Smooth" laser.FormFactor = "Custom" laser.CanCollide = false laser.Size = Vector3.new(0.35, 0.35, Distance) laser.CFrame = CFrame.new(position, Generator.GeneratorPart.Position) * CFrame.new(0, 0, -Distance/2) local ObjectClone = MapContents[RandomInstance]:clone() ObjectClone.Parent = MapHolder wait(0.01) laser:destroy() else local NonObjectClone = MapContents[RandomInstance]:clone() NonObjectClone.Parent = MapHolder end end |
|
|
| Report Abuse |
|
|
| 16 Nov 2015 07:29 PM |
| ok nvm i just noticed what's wrong with LOL |
|
|
| Report Abuse |
|