TheUnknownDiscord

Untitled

Oct 17th, 2021 (edited)
25
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. part = function()
  2.  
  3. local a = Instance.new("Part", script)
  4. a.CanCollide = true
  5. a.Size = Vector3.new(10, 10, 1)
  6. a.Color = Color3.fromRGB(184, 65, 65)
  7. a.Transparency = 0.7
  8. a.Material = "Neon"
  9. a.Anchored = true
  10. a.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(0,3,-3.5)
  11. return a
  12. end
  13. local active = false
  14. local replicating = false
  15. local root, a, b, c, d = nil, nil, nil, nil, nil
  16. replicate = function()
  17.  
  18. replicating = true
  19. script:ClearAllChildren()
  20. root = part()
  21. root.Transparency = 1
  22. root.Size = Vector3.new(0.2, 0.2, 0.2)
  23. root.CanCollide = false
  24. a = part()
  25. b = part()
  26. c = part()
  27. d = part()
  28. replicating = false
  29. end
  30. count = 0
  31. function wall()
  32. count = count + 1
  33. if count == 1 then
  34. active = true
  35. replicate()
  36. elseif count == 2 then
  37. active = false
  38. wait()
  39. a:Destroy()
  40. b:Destroy()
  41. c:Destroy()
  42. d:Destroy()
  43. root:Destroy()
  44. count = 0
  45. end
  46. end
  47. script.ChildRemoved:connect(function(a)
  48.  
  49. if a:IsA("BasePart") and replicating == false and active == true then
  50. replicate()
  51. end
  52. end
  53. )
  54. local E = Instance.new("RemoteEvent",NLS([[local E = script:FindFirstChildWhichIsA("RemoteEvent")
  55. local Mouse = owner:GetMouse()
  56. function ButtonDown(key)
  57. key = key:lower()
  58. if key == "q" then
  59. E:FireServer("Down")
  60. end
  61. end
  62. Mouse.KeyDown:Connect(ButtonDown)
  63. ]],owner.PlayerGui))
  64. E.OnServerEvent:Connect(wall)
  65.  
  66. pcall(function()
  67. while true do
  68. task.wait()
  69. while active do
  70. task.wait()
  71. a.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(0,2.5,-7)
  72. b.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(0,2.5,-7)
  73. c.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(0,2.5,-7)
  74. d.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(0,2.5,-7)
  75. root.CFrame = owner.Character.HumanoidRootPart.CFrame * CFrame.new(0,2.5,-7)
  76. end
  77. end
  78. end)
RAW Paste Data