HCTGT_scripta

Placement System (secret wall handler)

Jan 14th, 2021 (edited)
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.54 KB | None | 0 0
  1. game.ReplicatedStorage.Events.DrawSecretWall.OnServerEvent:Connect(function(Player, Plot)
  2.     local Wall1 = Instance.new("Part", Plot)
  3.     Wall1.Size = Vector3.new(Plot.Ground.Size.X, 50, 1)
  4.     Wall1.Anchored = true
  5.     Wall1.Transparency = .5
  6.     Wall1.Position = Plot.Ground.Position + Vector3.new(0, 25, Plot.Ground.Size.X / 2)
  7.     local Wall2 = Instance.new("Part", Plot)
  8.     Wall2.Size = Vector3.new(Plot.Ground.Size.X, 50, 1)
  9.     Wall2.Anchored = true
  10.     Wall2.Transparency = .5
  11.     Wall2.Position = Plot.Ground.Position + Vector3.new(0, 25, -Plot.Ground.Size.X / 2)
  12.     local Wall3 = Instance.new("Part", Plot)
  13.     Wall3.Size = Vector3.new(1, 50, Plot.Ground.Size.Z)
  14.     Wall3.Anchored = true
  15.     Wall3.Transparency = .5
  16.     Wall3.Position = Plot.Ground.Position + Vector3.new(Plot.Ground.Size.Z / 2, 25, 0)
  17.     local Wall4 = Instance.new("Part", Plot)
  18.     Wall4.Size = Vector3.new(1, 50, Plot.Ground.Size.Z)
  19.     Wall4.Anchored = true
  20.     Wall4.Transparency = .5
  21.     Wall4.Position = Plot.Ground.Position + Vector3.new(-Plot.Ground.Size.Z / 2, 25, 0)
  22.  
  23.     Wall1.Name = "Wall"
  24.     Wall2.Name = "Wall"
  25.     Wall3.Name = "Wall"
  26.     Wall4.Name = "Wall"
  27.     Wall1.BrickColor = BrickColor.Black()
  28.     Wall2.BrickColor = BrickColor.Black()
  29.     Wall3.BrickColor = BrickColor.Black()
  30.     Wall4.BrickColor = BrickColor.Black()
  31.     Wall1.CastShadow = false
  32.     Wall2.CastShadow = false
  33.     Wall3.CastShadow = false
  34.     Wall4.CastShadow = false
  35. end)
  36.  
  37. game.ReplicatedStorage.Events.RemoveSecretWall.OnServerEvent:Connect(function(Plr, Plot)
  38.     for _, O in pairs(Plot:GetChildren()) do
  39.         if O.Name == "Wall" then
  40.             O:Destroy()
  41.         end
  42.     end
  43. end)
Add Comment
Please, Sign In to add comment