Advertisement
Guest User

Austin's lua code

a guest
Apr 4th, 2020
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.36 KB | None | 0 0
  1. local WallCount = 1000
  2. local TimesToCircle = 5
  3. local WallTo360 = ((360 / WallCount) * TimesToCircle)
  4. local RadiusForWalls = 100
  5. local TimePerIteration= 0.5
  6. local HaveTowers = false
  7. local TowerWallToggle = true
  8. local RadiusForTowers = 430
  9. local CenterPoint =  Vector3.new(0, 0, 0)
  10. --local WallSize = Vector3.new(320, 100, 5)
  11. local TowerSize = Vector3.new(20, 120, 20)
  12. local WallSize = Vector3.new(1, 0.5, 20)
  13. local counter = 0
  14. for angle = 1, WallCount  do
  15.     counter = counter + 10
  16.     wait(TimePerIteration)
  17.     local Radians = math.rad(angle * WallTo360)
  18.     local Part = Instance.new("Part")
  19.     Part.Parent = workspace.Walls
  20.     if HaveTowers == true then
  21.         if TowerWallToggle == false then
  22.             Part.Size = WallSize
  23.             Part.Name = "Wall"
  24.             TowerWallToggle = true
  25.             X = math.cos(Radians) * RadiusForWalls
  26.             Z = math.sin(Radians)* RadiusForWalls
  27.         else
  28.             Part.Size = TowerSize
  29.             Part.Name = "Tower"
  30.             TowerWallToggle = false
  31.             X = math.cos(Radians) * RadiusForTowers
  32.             Z = math.sin(Radians)* RadiusForTowers
  33.         end
  34.     else
  35.         Part.Size = WallSize
  36.         Part.Name = "Wall"
  37.         X = math.cos(Radians) * RadiusForWalls
  38.         Z = math.sin(Radians)* RadiusForWalls
  39.     end
  40.     Part.Position = Vector3.new((X + CenterPoint.X), ((Part.Size.Y / 2) + CenterPoint.Y + counter), (Z + CenterPoint.Z))
  41.     Part.Orientation = Vector3.new(0, ((-WallTo360 * (angle - 1)) + (90 - WallTo360)), 0)
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement