Advertisement
joe201501

Chen's Shield

Feb 23rd, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local p = game.Players.LocalPlayer
  2. local char = p.Character
  3. local size = 8
  4. part = function()
  5.  
  6. sky = Instance.new("Sky",game.Lighting)
  7. sky.SunTextureId = "rbxassetid://188291834"
  8.  
  9. --Made by Auma
  10.  
  11. local s = Instance.new("Sound")
  12.  
  13. s.Name = "Sound"
  14. s.SoundId = "http://www.roblox.com/asset/?id=185617544"
  15. s.Volume = 2
  16. s.Looped = true
  17. s.archivable = false
  18.  
  19. s.Parent = p
  20.  
  21. s:play()
  22.  
  23. local a = Instance.new("Part", script)
  24. a.Anchored = true
  25. a.CanCollide = true
  26. a.CFrame = char.Torso.CFrame
  27. a.Size = Vector3.new(size, 0.2, 0.2)
  28. a.Transparency = 1
  29. return a
  30. end
  31.  
  32. part2 = function()
  33.  
  34. local a = Instance.new("Part", script)
  35. a.Anchored = true
  36. a.CanCollide = true
  37. a.CFrame = char.Torso.CFrame
  38. a.Size = Vector3.new(0.2, size, 0.2)
  39. a.Transparency = 1
  40. return a
  41. end
  42.  
  43. part3 = function()
  44.  
  45. local a = Instance.new("Part", script)
  46. a.Anchored = true
  47. a.CanCollide = false
  48. a.Size = Vector3.new(size, size, 1)
  49. a.Transparency = 0.7
  50. a.Material = "Neon"
  51. a.BrickColor = BrickColor.new("Really black")
  52. local b = Instance.new("BlockMesh", a)
  53. b.Scale = Vector3.new(1, 1, 0)
  54. return a
  55. end
  56.  
  57. local replicating = false
  58. local root, a, b, c, d, a2, b2, c2, d2, aa, bb, cc, dd, z, x, c, v, b, n = nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil
  59. replicate = function()
  60.  
  61. replicating = true
  62. script:ClearAllChildren()
  63. root = part()
  64. root.Transparency = 1
  65. root.Size = Vector3.new(0.2, 0.2, 0.2)
  66. root.CanCollide = false
  67. a = part()
  68. b = part()
  69. c = part()
  70. d = part()
  71. a2 = part()
  72. b2 = part()
  73. c2 = part()
  74. d2 = part()
  75. aa = part2()
  76. bb = part2()
  77. cc = part2()
  78. dd = part2()
  79. z = part3()
  80. x = part3()
  81. c = part3()
  82. v = part3()
  83. b = part3()
  84. n = part3()
  85. replicating = false
  86. end
  87.  
  88. script.ChildRemoved:connect(function(a)
  89.  
  90. if a.ClassName == "Part" and replicating == false then
  91. replicate()
  92. end
  93. end
  94. )
  95. replicate()
  96. local tick = 0
  97. CreateRegion3FromLocAndSize = function(Position, Size)
  98.  
  99. local SizeOffset = Size / 2
  100. local Point1 = Position - SizeOffset
  101. local Point2 = Position + SizeOffset
  102. return Region3.new(Point1, Point2)
  103. end
  104.  
  105. local set = false
  106. local whitelist = {"Hieroku", "PPATTA", "DevGamerzz", "I kill U", "kash5", "ZeroCrimson", "Zaidia", "tsup2", "PointCoded", "CLarramore", "Suzuuki", "", "", ""}
  107. p.Chatted:connect(function(ms)
  108.  
  109. if ms:sub(1, 5) == "size-" then
  110. size = tonumber(ms:sub(6))
  111. replicate()
  112. else
  113. if ms:sub(1, 4) == "set-" then
  114. set = true
  115. z.CanCollide = false
  116. x.CanCollide = false
  117. c.CanCollide = false
  118. v.CanCollide = false
  119. b.CanCollide = false
  120. n.CanCollide = false
  121. else
  122. if ms:sub(1, 6) == "unset-" then
  123. set = false
  124. z.CanCollide = false
  125. x.CanCollide = false
  126. c.CanCollide = false
  127. v.CanCollide = false
  128. b.CanCollide = false
  129. n.CanCollide = false
  130. else
  131. if ms:sub(1, 10) == "whitelist-" then
  132. table.insert(whitelist, ms:sub(11))
  133. else
  134. if ms:sub(1, 12) == "unwhitelist-" then
  135. for i,v in pairs(whitelist) do
  136. if ms:sub(13) == v then
  137. table.remove(whitelist, i)
  138. break
  139. end
  140. end
  141. end
  142. end
  143. end
  144. end
  145. end
  146. end
  147. )
  148. local magicpos = nil
  149. game:GetService("RunService").Heartbeat:connect(function()
  150.  
  151. pcall(function()
  152.  
  153. local void = char:GetChildren()
  154. for _,pl in pairs(whitelist) do
  155. if game.Players:FindFirstChild(pl) ~= nil and game.Players:FindFirstChild(pl).Character ~= nil then
  156. for i,v in pairs(game.Players[pl].Character:GetChildren()) do
  157. table.insert(void, v)
  158. end
  159. end
  160. end
  161. for i,v in pairs(game.Players:GetPlayers()) do
  162. if v.Character:isDescendantOf(char) and not v.Name == "FangxWulf" then
  163. v:LoadCharacter()
  164. end
  165. end
  166. char.Humanoid.Health = math.huge
  167. tick = tick + 0.01
  168. if not set then
  169. root.CFrame = root.CFrame:lerp(CFrame.new(char.Torso.CFrame.p) * CFrame.Angles(math.sin(tick) * 100 / 30 / (size / 2), math.cos(tick) * 100 / 30 / (size / 2), math.cos(tick) * 100 / 30 / (size / 2)), 0.1)
  170. magicpos = char.Torso.CFrame
  171. else
  172. root.CFrame = root.CFrame:lerp(CFrame.new(magicpos.p) * CFrame.Angles(0, 0, 0), 0.05)
  173. end
  174. local reg = CreateRegion3FromLocAndSize(root.CFrame.p, Vector3.new(size, size, size))
  175. for i,v in pairs(game.Workspace:FindPartsInRegion3WithIgnoreList(reg, void, 100)) do
  176. if v.Name ~= "Base" then
  177. v:Destroy()
  178. end
  179. end
  180. a.CFrame = root.CFrame * CFrame.new(size / 2, size / 2, 0) * CFrame.Angles(0, math.rad(90), 0)
  181. b.CFrame = root.CFrame * CFrame.new(-size / 2, size / 2, 0) * CFrame.Angles(0, math.rad(90), 0)
  182. c.CFrame = root.CFrame * CFrame.new(0, size / 2, size / 2)
  183. d.CFrame = root.CFrame * CFrame.new(0, size / 2, -size / 2)
  184. a2.CFrame = root.CFrame * CFrame.new(size / 2, -size / 2, 0) * CFrame.Angles(0, math.rad(90), 0)
  185. b2.CFrame = root.CFrame * CFrame.new(-size / 2, -size / 2, 0) * CFrame.Angles(0, math.rad(90), 0)
  186. c2.CFrame = root.CFrame * CFrame.new(0, -size / 2, size / 2)
  187. d2.CFrame = root.CFrame * CFrame.new(0, -size / 2, -size / 2)
  188. aa.CFrame = root.CFrame * CFrame.new(size / 2, 0, size / 2)
  189. bb.CFrame = root.CFrame * CFrame.new(-size / 2, 0, size / 2)
  190. cc.CFrame = root.CFrame * CFrame.new(-size / 2, 0, -size / 2)
  191. dd.CFrame = root.CFrame * CFrame.new(size / 2, 0, -size / 2)
  192. z.CFrame = root.CFrame * CFrame.new(size / 2, 0, 0) * CFrame.Angles(0, math.rad(90), 0)
  193. x.CFrame = root.CFrame * CFrame.new(-size / 2, 0, 0) * CFrame.Angles(0, math.rad(90), 0)
  194. c.CFrame = root.CFrame * CFrame.new(0, 0, size / 2) * CFrame.Angles(0, 0, math.rad(90))
  195. v.CFrame = root.CFrame * CFrame.new(0, 0, -size / 2) * CFrame.Angles(0, 0, math.rad(90))
  196. b.CFrame = root.CFrame * CFrame.new(0, size / 2, 0) * CFrame.Angles(math.rad(90), 0, 0)
  197. n.CFrame = root.CFrame * CFrame.new(0, -size / 2, 0) * CFrame.Angles(math.rad(90), 0, 0)
  198. end
  199. )
  200. end
  201. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement