Advertisement
dahpiglz

Shield Script

Oct 29th, 2017
1,378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 23.66 KB | None | 0 0
  1. --ForceField
  2.  
  3.  
  4. --Intro
  5.  
  6. playintro = 0
  7.  
  8. if playintro == 1 then
  9. introtypespeed = 0.2
  10. introerasespeed = 0.05
  11. local introscreengui = Instance.new("ScreenGui")
  12. local introlabel = Instance.new("TextLabel")
  13. introscreengui.Parent = game:GetService("Players").LocalPlayer.PlayerGui
  14. introlabel.Parent = introscreengui
  15. introlabel.BackgroundTransparency = 1
  16. introlabel.Size = UDim2.new(0, 1270, 0, 707)
  17. introlabel.Position = UDim2.new(0, 350, 0, 0)
  18. introlabel.TextColor3 = Color3.new(130, 203, 255)
  19. introlabel.TextSize = 100
  20. introlabel.TextStrokeTransparency = (0)
  21. introlabel.Text = ("F")
  22. wait(introtypespeed)
  23. introlabel.Text = ("Fo")
  24. wait(introtypespeed)
  25. introlabel.Text = ("For")
  26. wait(introtypespeed)
  27. introlabel.Text = ("Forc")
  28. wait(introtypespeed)
  29. introlabel.Text = ("Force")
  30. wait(introtypespeed)
  31. introlabel.Text = ("Force ")
  32. wait(introtypespeed)
  33. introlabel.Text = ("Force F")
  34. wait(introtypespeed)
  35. introlabel.Text = ("Force Fi")
  36. wait(introtypespeed)
  37. introlabel.Text = ("Force Fie")
  38. wait(introtypespeed)
  39. introlabel.Text = ("Force Fiel")
  40. wait(introtypespeed)
  41. introlabel.Text = ("Force Field")
  42. wait(0.5)
  43. wait(introtypespeed)
  44. introlabel.Text = ("Force Fiel")
  45. wait(introerasespeed)
  46. introlabel.Text = ("Force Fie")
  47. wait(introerasespeed)
  48. introlabel.Text = ("Force Fi")
  49. wait(introerasespeed)
  50. introlabel.Text = ("Force F")
  51. wait(introerasespeed)
  52. introlabel.Text = ("Force ")
  53. wait(introerasespeed)
  54. introlabel.Text = ("Force")
  55. wait(introerasespeed)
  56. introlabel.Text = ("Forc")
  57. wait(introerasespeed)
  58. introlabel.Text = ("For")
  59. wait(introerasespeed)
  60. introlabel.Text = ("Fo")
  61. wait(introerasespeed)
  62. introlabel.Text = ("F")
  63. wait(introerasespeed)
  64. introlabel.Text = ("")
  65. end
  66.  
  67.  
  68.  
  69. print("ForceField Script Loaded")
  70.  
  71. local player = game:GetService("Players").LocalPlayer
  72. local character = player.Character
  73. local mouse = player:GetMouse()
  74.  
  75. local head = character.Head
  76. local torso = nil
  77.  
  78. if character.Humanoid.RigType == Enum.HumanoidRigType.R6 then
  79.     torso = character.Torso
  80.     else
  81.     torso = character.UpperTorso
  82. end
  83.  
  84. shieldon = true
  85. shieldsize = 10
  86. shieldgrowrate = 0.025
  87. shieldv = nil
  88.  
  89. local PermissionList = {}
  90. --local user1 = ("")
  91. --local user2 = ("")
  92. --local user3 = ("")
  93.  
  94. --Shield Customization
  95.  
  96. shieldtransparency = 0.7
  97. shieldcolor = BrickColor.new("Bright red")
  98. shieldmaterial = ("Neon")
  99. shieldshape = ("Block")
  100.  
  101. --Other Stuff
  102. character.Humanoid.MaxHealth = math.huge
  103. character.Humanoid.Health = math.huge
  104.  
  105. ff = Instance.new("ForceField")
  106. ff.Visible = false
  107. ff.Parent = character
  108.  
  109. --container1 = Instance.new("Folder")
  110. --container1.Parent = game.Workspace
  111. --character.Parent = container1
  112.  
  113. --h = Instance.new("Humanoid")
  114. --h.Parent = container1
  115.  
  116. --Clear Old Gui
  117. if player.PlayerGui:FindFirstChild("ShieldGui") ~= nil then
  118.     player.PlayerGui.ShieldGui:Destroy()
  119. end
  120.  
  121. --Make Gui
  122. local screenguia = Instance.new("ScreenGui")
  123. screenguia.Parent = player.PlayerGui
  124. screenguia.Name = ("ShieldGui")
  125.  
  126. local screengui = Instance.new("Frame")
  127. screengui.Parent = screenguia
  128. screengui.Name = ("Frame")
  129. screengui.BackgroundTransparency = 1
  130.  
  131. screengui.Size = UDim2.new(1, 0, 1, 0)
  132. screengui.Position = UDim2.new(0, 0, 0, 0)
  133.  
  134. permissionlistgui = Instance.new("Frame")
  135. permissionlistgui.Parent = screengui
  136. permissionlistgui.Name = ("PermissionListGui")
  137. permissionlistgui.BackgroundTransparency = 1
  138.  
  139. permissionlistgui.Size = UDim2.new(1, 0, 1, 0)
  140. permissionlistgui.Position = UDim2.new(0, 0, 0, 0)
  141.  
  142. customizeguiopen = false
  143. local screengui2 = Instance.new("Frame")
  144. screengui2.Parent = screenguia
  145. screengui2.Visible = false
  146. screengui2.Name = ("Customize")
  147. screengui2.BackgroundTransparency = 1
  148.  
  149. screengui2.Size = UDim2.new(1, 0, 1, 0)
  150. screengui2.Position = UDim2.new(0, 0, 0, 0)
  151.  
  152. --Create shield visual
  153.  
  154. s = Instance.new("Part")
  155. s.Anchored = true
  156. s.CanCollide = false
  157. s.Parent = game.Workspace
  158. s.TopSurface = ("Smooth")
  159. s.BottomSurface = ("Smooth")
  160. s.Transparency = shieldtransparency
  161. s.BrickColor = shieldcolor
  162. s.Material = shieldmaterial
  163. s.Size = Vector3.new(0,0,0)
  164. s.Name = ("ShieldVisual")
  165. shieldv = s
  166.  
  167.  
  168. --Size Gui
  169.  
  170.  
  171. local textbutton1 = Instance.new("TextButton")
  172. local textbar1 = Instance.new("TextBox")
  173. textbar1.Parent = screengui
  174. textbar1.Position = UDim2.new(0, 0, 0.370, 0)
  175. textbar1.Size = UDim2.new(0, 126, 0, 18)
  176. textbar1.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  177. textbar1.TextColor3 = Color3.new(240, 240, 240)
  178. textbar1.BackgroundTransparency = (0)
  179. textbar1.BorderSizePixel = (0)
  180. textbar1.Text = ("10")
  181. textbutton1.Parent = screengui
  182. textbutton1.Text = ("Apply Size")
  183. textbutton1.Position = UDim2.new(0, 0, 0.352, 0)
  184. textbutton1.Size = UDim2.new(0, 126, 0, 18)
  185. textbutton1.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  186. textbutton1.TextColor3 = Color3.new(240, 240, 240)
  187. textbutton1.BackgroundTransparency = (0)
  188. textbutton1.BorderSizePixel = (0)
  189.  
  190. function onClick()
  191.     n = tonumber(textbar1.Text)
  192.     shieldsize = n
  193.     --shieldv:TweenSize(Vector3.new(n, n, n), Enum.EasingDirection.In, Enum.EasingStyle.Linear, shieldgrowrate, false);
  194. end
  195.  
  196. textbutton1.MouseButton1Click:connect(onClick)
  197.  
  198.  
  199. --local textbutton11 = Instance.new("TextButton")
  200. --local textbar11 = Instance.new("TextLabel")
  201. --textbar11.Parent = screengui
  202. --textbar11.Text = game:GetService("Players").LocalPlayer.Name
  203. --textbar11.Position = UDim2.new(0, 0, 0.494, 0)
  204. --textbar11.Size = UDim2.new(0, 126, 0, 18)
  205. --textbar11.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  206. --textbar11.TextColor3 = Color3.new(58, 58, 58)
  207. --textbar11.BackgroundTransparency = (0)
  208. --textbar11.BorderSizePixel = (0)
  209.  
  210.  
  211.  
  212.  
  213. local textbutton11 = Instance.new("TextButton")
  214. textbutton11.Parent = screengui
  215. textbutton11.Text = ("Apply Access Changes")
  216. textbutton11.Position = UDim2.new(0, 0, 0.476, 0)
  217. textbutton11.Size = UDim2.new(0, 126, 0, 18)
  218. textbutton11.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  219. textbutton11.TextColor3 = Color3.new(240, 240, 240)
  220. textbutton11.BackgroundTransparency = (0)
  221. textbutton11.BorderSizePixel = (0)
  222.  
  223. local textbutton11a = Instance.new("TextButton")
  224. textbutton11a.Parent = screengui
  225. textbutton11a.Text = ("+")
  226. textbutton11a.Position = UDim2.new(0.068, 0, 0.476, 0)
  227. textbutton11a.Size = UDim2.new(0, 18, 0, 18)
  228. textbutton11a.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  229. textbutton11a.TextColor3 = Color3.new(240, 240, 240)
  230. textbutton11a.BackgroundTransparency = (0)
  231. textbutton11a.BorderSizePixel = (0)
  232.  
  233. local textbutton11b = Instance.new("TextButton")
  234. textbutton11b.Parent = screengui
  235. textbutton11b.Text = ("-")
  236. textbutton11b.Position = UDim2.new(0.078, 0, 0.476, 0)
  237. textbutton11b.Size = UDim2.new(0, 18, 0, 18)
  238. textbutton11b.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  239. textbutton11b.TextColor3 = Color3.new(240, 240, 240)
  240. textbutton11b.BackgroundTransparency = (0)
  241. textbutton11b.BorderSizePixel = (0)
  242.  
  243. nextpermissionlistslotposition = 0.512
  244.  
  245. function onClick()
  246.     local textbar12 = Instance.new("TextBox")
  247.     textbar12.Parent = permissionlistgui
  248.     textbar12.Position = UDim2.new(0, 0, nextpermissionlistslotposition, 0)
  249.     textbar12.Size = UDim2.new(0, 126, 0, 18)
  250.     textbar12.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  251.     textbar12.TextColor3 = Color3.new(240, 240, 240)
  252.     textbar12.BackgroundTransparency = (0)
  253.     textbar12.BorderSizePixel = (0)
  254.     textbar12.Text = ("Player Name")
  255.  
  256.     nextpermissionlistslotposition = nextpermissionlistslotposition + 0.018
  257. end
  258.  
  259. textbutton11a.MouseButton1Click:connect(onClick)
  260.  
  261. function onClick()
  262.     local lookingfor = #permissionlistgui:GetChildren()
  263.     for i,v in pairs(permissionlistgui:GetChildren()) do
  264.         if i == lookingfor then
  265.             v:Destroy()
  266.             nextpermissionlistslotposition = nextpermissionlistslotposition - 0.018
  267.         end
  268.     end
  269. end
  270.  
  271. textbutton11b.MouseButton1Click:connect(onClick)
  272.  
  273. function onClick()
  274.     for i = 1, #PermissionList do
  275.         PermissionList[i] = nil
  276.     end
  277.     for i,v in pairs(permissionlistgui:GetChildren()) do
  278.         PermissionList[i] = v.Text
  279.     end
  280. end
  281.  
  282. textbutton11.MouseButton1Click:connect(onClick)
  283.  
  284.  
  285.  
  286.  
  287.  
  288. --Toggle Gui
  289.  
  290.  
  291. local textbutton2 = Instance.new("TextButton")
  292. textbutton2.Parent = screengui
  293. textbutton2.Text = ("Toggle Shield Off")
  294. textbutton2.Position = UDim2.new(0, 0, 0.406, 0)
  295. textbutton2.Size = UDim2.new(0, 126, 0, 18)
  296. textbutton2.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  297. textbutton2.TextColor3 = Color3.new(240, 240, 240)
  298. textbutton2.BackgroundTransparency = (0)
  299. textbutton2.BorderSizePixel = (0)
  300.  
  301. function onClick()
  302.     if shieldon == true then
  303.         shieldon = false
  304.         character.Humanoid.MaxHealth = 100
  305.         character.Humanoid.Health = 100
  306.         shieldv.Transparency = 1
  307.         ff.Parent = nil
  308.         textbutton2.Text = ("Toggle Shield On")
  309.     else
  310.         shieldon = true
  311.         character.Humanoid.MaxHealth = math.huge
  312.         character.Humanoid.Health = math.huge
  313.         shieldv.Transparency = shieldtransparency
  314.         ff.Parent = character
  315.         textbutton2.Text = ("Toggle Shield Off")
  316.     end
  317. end
  318.  
  319. textbutton2.MouseButton1Click:connect(onClick)
  320.  
  321. --Toggle Customization Gui
  322.  
  323. local textbutton3 = Instance.new("TextButton")
  324. textbutton3.Parent = screengui
  325. textbutton3.Text = ("Customize")
  326. textbutton3.Position = UDim2.new(0, 0, 0.440, 0)
  327. textbutton3.Size = UDim2.new(0, 126, 0, 18)
  328. textbutton3.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  329. textbutton3.TextColor3 = Color3.new(240, 240, 240)
  330. textbutton3.BackgroundTransparency = (0)
  331. textbutton3.BorderSizePixel = (0)
  332.  
  333. function onClick()
  334.     if customizeguiopen == true then
  335.         customizeguiopen = false
  336.         screengui2.Visible = false
  337.     else
  338.         customizeguiopen = true
  339.         screengui2.Visible = true
  340.     end
  341. end
  342.  
  343. textbutton3.MouseButton1Click:connect(onClick)
  344.  
  345.  
  346. --Shield Colors
  347.  
  348.  
  349. --Red
  350. local textbuttonc1 = Instance.new("TextButton")
  351. textbuttonc1.Parent = screengui2
  352. textbuttonc1.Text = ("Red Shield Color")
  353. textbuttonc1.Position = UDim2.new(0.88, 0, 0.440, 0)
  354. textbuttonc1.Size = UDim2.new(0, 126, 0, 18)
  355. textbuttonc1.BackgroundColor3 = Color3.fromRGB(128, 30, 30)
  356. textbuttonc1.TextColor3 = Color3.new(240, 240, 240)
  357. textbuttonc1.BackgroundTransparency = (0)
  358. textbuttonc1.BorderSizePixel = (0)
  359.  
  360. function onClick()
  361.     shieldv.BrickColor = BrickColor.new("Bright red")
  362.     shieldcolor = BrickColor.new("Bright red")
  363. end
  364. textbuttonc1.MouseButton1Click:connect(onClick)
  365.  
  366. --Green
  367. local textbuttonc2 = Instance.new("TextButton")
  368. textbuttonc2.Parent = screengui2
  369. textbuttonc2.Text = ("Green Shield Color")
  370. textbuttonc2.Position = UDim2.new(0.88, 0, 0.458, 0)
  371. textbuttonc2.Size = UDim2.new(0, 126, 0, 18)
  372. textbuttonc2.BackgroundColor3 = Color3.fromRGB(30, 128, 30)
  373. textbuttonc2.TextColor3 = Color3.new(240, 240, 240)
  374. textbuttonc2.BackgroundTransparency = (0)
  375. textbuttonc2.BorderSizePixel = (0)
  376.  
  377. function onClick()
  378.     shieldv.BrickColor = BrickColor.new("Bright green")
  379.     shieldcolor = BrickColor.new("Bright green")
  380. end
  381. textbuttonc2.MouseButton1Click:connect(onClick)
  382.  
  383. --Blue
  384. local textbuttonc3 = Instance.new("TextButton")
  385. textbuttonc3.Parent = screengui2
  386. textbuttonc3.Text = ("Blue Shield Color")
  387. textbuttonc3.Position = UDim2.new(0.88, 0, 0.476, 0)
  388. textbuttonc3.Size = UDim2.new(0, 126, 0, 18)
  389. textbuttonc3.BackgroundColor3 = Color3.fromRGB(30, 30, 128)
  390. textbuttonc3.TextColor3 = Color3.new(240, 240, 240)
  391. textbuttonc3.BackgroundTransparency = (0)
  392. textbuttonc3.BorderSizePixel = (0)
  393.  
  394. function onClick()
  395.     shieldv.BrickColor = BrickColor.new("Really blue")
  396.     shieldcolor = BrickColor.new("Really blue")
  397. end
  398. textbuttonc3.MouseButton1Click:connect(onClick)
  399.  
  400. --Yellow
  401. local textbuttonc5 = Instance.new("TextButton")
  402. textbuttonc5.Parent = screengui2
  403. textbuttonc5.Text = ("Yellow Shield Color")
  404. textbuttonc5.Position = UDim2.new(0.88, 0, 0.494, 0)
  405. textbuttonc5.Size = UDim2.new(0, 126, 0, 18)
  406. textbuttonc5.BackgroundColor3 = Color3.fromRGB(128, 128, 30)
  407. textbuttonc5.TextColor3 = Color3.new(128, 128, 30)
  408. textbuttonc5.BackgroundTransparency = (0)
  409. textbuttonc5.BorderSizePixel = (0)
  410.  
  411. function onClick()
  412.     shieldv.BrickColor = BrickColor.new("New Yeller")
  413.     shieldcolor = BrickColor.new("New Yeller")
  414. end
  415. textbuttonc5.MouseButton1Click:connect(onClick)
  416.  
  417. --Pink
  418. local textbuttonc6 = Instance.new("TextButton")
  419. textbuttonc6.Parent = screengui2
  420. textbuttonc6.Text = ("Pink Shield Color")
  421. textbuttonc6.Position = UDim2.new(0.88, 0, 0.512, 0)
  422. textbuttonc6.Size = UDim2.new(0, 126, 0, 18)
  423. textbuttonc6.BackgroundColor3 = Color3.fromRGB(128, 30, 95)
  424. textbuttonc6.TextColor3 = Color3.new(240, 240, 240)
  425. textbuttonc6.BackgroundTransparency = (0)
  426. textbuttonc6.BorderSizePixel = (0)
  427.  
  428. function onClick()
  429.     shieldv.BrickColor = BrickColor.new("Hot pink")
  430.     shieldcolor = BrickColor.new("Hot pink")
  431. end
  432. textbuttonc6.MouseButton1Click:connect(onClick)
  433.  
  434. --White
  435. local textbuttonc7 = Instance.new("TextButton")
  436. textbuttonc7.Parent = screengui2
  437. textbuttonc7.Text = ("White Shield Color")
  438. textbuttonc7.Position = UDim2.new(0.88, 0, 0.530, 0)
  439. textbuttonc7.Size = UDim2.new(0, 126, 0, 18)
  440. textbuttonc7.BackgroundColor3 = Color3.fromRGB(128, 128, 128)
  441. textbuttonc7.TextColor3 = Color3.new(240, 240, 240)
  442. textbuttonc7.BackgroundTransparency = (0)
  443. textbuttonc7.BorderSizePixel = (0)
  444.  
  445. function onClick()
  446.     shieldv.BrickColor = BrickColor.new("Institutional white")
  447.     shieldcolor = BrickColor.new("Institutional white")
  448. end
  449. textbuttonc7.MouseButton1Click:connect(onClick)
  450.  
  451. --Black
  452. local textbuttonc8 = Instance.new("TextButton")
  453. textbuttonc8.Parent = screengui2
  454. textbuttonc8.Text = ("Black Shield Color")
  455. textbuttonc8.Position = UDim2.new(0.88, 0, 0.548, 0)
  456. textbuttonc8.Size = UDim2.new(0, 126, 0, 18)
  457. textbuttonc8.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  458. textbuttonc8.TextColor3 = Color3.new(240, 240, 240)
  459. textbuttonc8.BackgroundTransparency = (0)
  460. textbuttonc8.BorderSizePixel = (0)
  461.  
  462. function onClick()
  463.     shieldv.BrickColor = BrickColor.new("Really black")
  464.     shieldcolor = BrickColor.new("Really black")
  465. end
  466. textbuttonc8.MouseButton1Click:connect(onClick)
  467.  
  468. --Transparency Options
  469. local textbuttonc4 = Instance.new("TextButton")
  470. local textbarc4 = Instance.new("TextBox")
  471. textbarc4.Parent = screengui2
  472. textbarc4.Position = UDim2.new(0.88, 0, 0.406, 0)
  473. textbarc4.Size = UDim2.new(0, 126, 0, 18)
  474. textbarc4.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  475. textbarc4.TextColor3 = Color3.new(240, 240, 240)
  476. textbarc4.BackgroundTransparency = (0)
  477. textbarc4.BorderSizePixel = (0)
  478. textbarc4.Text = (shieldtransparency)
  479. textbuttonc4.Parent = screengui2
  480. textbuttonc4.Text = ("Apply Transparency")
  481. textbuttonc4.Position = UDim2.new(0.88, 0, 0.388, 0)
  482. textbuttonc4.Size = UDim2.new(0, 126, 0, 18)
  483. textbuttonc4.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  484. textbuttonc4.TextColor3 = Color3.new(240, 240, 240)
  485. textbuttonc4.BackgroundTransparency = (0)
  486. textbuttonc4.BorderSizePixel = (0)
  487.  
  488. function onClick()
  489.     n = tonumber(textbarc4.Text)
  490.     shieldtransparency = n
  491.     shieldv.Transparency = n
  492. end
  493.  
  494. textbuttonc4.MouseButton1Click:connect(onClick)
  495.  
  496. --Block Shape
  497.  
  498. local textbuttonc9 = Instance.new("TextButton")
  499. textbuttonc9.Parent = screengui2
  500. textbuttonc9.Text = ("Block Shape")
  501. textbuttonc9.Position = UDim2.new(0.88, 0, 0.584, 0)
  502. textbuttonc9.Size = UDim2.new(0, 126, 0, 18)
  503. textbuttonc9.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  504. textbuttonc9.TextColor3 = Color3.new(240, 240, 240)
  505. textbuttonc9.BackgroundTransparency = (0)
  506. textbuttonc9.BorderSizePixel = (0)
  507.  
  508. function onClick()
  509.     shieldshape = ("Block")
  510.     shieldv.Shape = ("Block")
  511. end
  512. textbuttonc9.MouseButton1Click:connect(onClick)
  513.  
  514. --Sphere Shape
  515.  
  516. local textbuttonc10 = Instance.new("TextButton")
  517. textbuttonc10.Parent = screengui2
  518. textbuttonc10.Text = ("Sphere Shape")
  519. textbuttonc10.Position = UDim2.new(0.88, 0, 0.602, 0)
  520. textbuttonc10.Size = UDim2.new(0, 126, 0, 18)
  521. textbuttonc10.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  522. textbuttonc10.TextColor3 = Color3.new(240, 240, 240)
  523. textbuttonc10.BackgroundTransparency = (0)
  524. textbuttonc10.BorderSizePixel = (0)
  525.  
  526. function onClick()
  527.     shieldshape = ("Ball")
  528.     shieldv.Shape = ("Ball")
  529. end
  530. textbuttonc10.MouseButton1Click:connect(onClick)
  531.  
  532. --Neon Material
  533.  
  534. local textbuttonc11 = Instance.new("TextButton")
  535. textbuttonc11.Parent = screengui2
  536. textbuttonc11.Text = ("Neon Material")
  537. textbuttonc11.Position = UDim2.new(0.88, 0, 0.638, 0)
  538. textbuttonc11.Size = UDim2.new(0, 126, 0, 18)
  539. textbuttonc11.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  540. textbuttonc11.TextColor3 = Color3.new(240, 240, 240)
  541. textbuttonc11.BackgroundTransparency = (0)
  542. textbuttonc11.BorderSizePixel = (0)
  543.  
  544. function onClick()
  545.     shieldmaterial = ("Neon")
  546.     shieldv.Material = ("Neon")
  547. end
  548. textbuttonc11.MouseButton1Click:connect(onClick)
  549.  
  550. --SmoothPlastic Material
  551.  
  552. local textbuttonc12 = Instance.new("TextButton")
  553. textbuttonc12.Parent = screengui2
  554. textbuttonc12.Text = ("SmoothPlastic Material")
  555. textbuttonc12.Position = UDim2.new(0.88, 0, 0.656, 0)
  556. textbuttonc12.Size = UDim2.new(0, 126, 0, 18)
  557. textbuttonc12.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  558. textbuttonc12.TextColor3 = Color3.new(240, 240, 240)
  559. textbuttonc12.BackgroundTransparency = (0)
  560. textbuttonc12.BorderSizePixel = (0)
  561.  
  562. function onClick()
  563.     shieldmaterial = ("SmoothPlastic")
  564.     shieldv.Material = ("SmoothPlastic")
  565. end
  566. textbuttonc12.MouseButton1Click:connect(onClick)
  567.  
  568. --Plastic Material
  569.  
  570. local textbuttonc13 = Instance.new("TextButton")
  571. textbuttonc13.Parent = screengui2
  572. textbuttonc13.Text = ("Plastic Material")
  573. textbuttonc13.Position = UDim2.new(0.88, 0, 0.674, 0)
  574. textbuttonc13.Size = UDim2.new(0, 126, 0, 18)
  575. textbuttonc13.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  576. textbuttonc13.TextColor3 = Color3.new(240, 240, 240)
  577. textbuttonc13.BackgroundTransparency = (0)
  578. textbuttonc13.BorderSizePixel = (0)
  579.  
  580. function onClick()
  581.     shieldmaterial = ("Plastic")
  582.     shieldv.Material = ("Plastic")
  583. end
  584. textbuttonc13.MouseButton1Click:connect(onClick)
  585.  
  586. --Glass Material
  587.  
  588. local textbuttonc14 = Instance.new("TextButton")
  589. textbuttonc14.Parent = screengui2
  590. textbuttonc14.Text = ("Glass Material")
  591. textbuttonc14.Position = UDim2.new(0.88, 0, 0.692, 0)
  592. textbuttonc14.Size = UDim2.new(0, 126, 0, 18)
  593. textbuttonc14.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  594. textbuttonc14.TextColor3 = Color3.new(240, 240, 240)
  595. textbuttonc14.BackgroundTransparency = (0)
  596. textbuttonc14.BorderSizePixel = (0)
  597.  
  598. function onClick()
  599.     shieldmaterial = ("Glass")
  600.     shieldv.Material = ("Glass")
  601. end
  602. textbuttonc14.MouseButton1Click:connect(onClick)
  603.  
  604.  
  605. --platforms
  606.  
  607.  
  608. hasplatform = 0
  609.  
  610. game:GetService("UserInputService").InputBegan:connect(function(input)
  611. if input.KeyCode == Enum.KeyCode.Tab then
  612.     platform = Instance.new("Part")
  613.     platform.BrickColor = BrickColor.new("Bright green")
  614.     platform.Parent = character
  615.     platform.Name = ("Platform")
  616.     platform.Reflectance = 0.5
  617.     platform.Transparency = 0.5
  618.     platform.Size = Vector3.new(0.05,3,3)
  619.     platform.Orientation = Vector3.new(0,0,90)
  620.     platform.Shape = ("Cylinder")
  621.     platform.Anchored = true
  622.     hasplatform = 1
  623. end
  624. end)
  625.  
  626. game:GetService("UserInputService").InputEnded:connect(function(input)
  627. if input.KeyCode == Enum.KeyCode.Tab then
  628.     character.Platform:Destroy()
  629.     hasplatform = 0
  630. end
  631. end)
  632.  
  633. ghostmode = 0
  634.  
  635. game:GetService("UserInputService").InputBegan:connect(function(input)
  636. if input.KeyCode == Enum.KeyCode.LeftAlt then
  637.     if ghostmode == 0 then
  638.         ghostmode = 1
  639.         character.Parent =  game.Workspace.Camera
  640.         for i,v in pairs(character:GetChildren()) do
  641.             if v.ClassName == ("Part") then
  642.                 if v.Name ~= ("HumanoidRootPart") then
  643.                     v.Transparency = 0.5
  644.                 end
  645.             end
  646.         end
  647.     else
  648.         ghostmode = 0
  649.         character.Parent = game.Workspace
  650.         for i,v in pairs(character:GetChildren()) do
  651.             if v.ClassName == ("Part") then
  652.                 if v.Name ~= ("HumanoidRootPart") then
  653.                     v.Transparency = 0
  654.                 end
  655.             end
  656.         end
  657.     end
  658. end
  659. end)
  660.  
  661. game:GetService("UserInputService").InputEnded:connect(function(input)
  662. if input.KeyCode == Enum.KeyCode.T then
  663.     --for i,v in pairs(PermissionList) do
  664.     --  print(v)
  665.     --end
  666. end
  667. end)
  668.  
  669. --While true do stuff
  670.  
  671. function rstepped()
  672.     if shieldv ~= nil and shieldv.Parent ~= nil then
  673.         shieldv.CFrame = character.Head.CFrame
  674.     else
  675.         if shieldv ~= nil then
  676.             shieldv:Destroy()
  677.         end
  678.         local s = Instance.new("Part")
  679.         s.Anchored = true
  680.         s.CanCollide = false
  681.         s.Parent = game.Workspace
  682.         s.TopSurface = ("Smooth")
  683.         s.BottomSurface = ("Smooth")
  684.         s.Transparency = shieldtransparency
  685.         s.BrickColor = shieldcolor
  686.         s.Material = shieldmaterial
  687.         s.Size = Vector3.new(shieldsize, shieldsize, shieldsize)
  688.         s.Shape = shieldshape
  689.         s.Name = ("ShieldVisual")
  690.         shieldv = s
  691.     end
  692. end
  693.  
  694. game:GetService("RunService").RenderStepped:Connect(rstepped)
  695.  
  696. while true do
  697.     wait(0.01)
  698.  
  699.  
  700.     --Destroy Intruders
  701.  
  702.     if shieldon == true then
  703.         for i,v in pairs(game.Workspace:GetChildren()) do
  704.             if v:IsA("BasePart") == true then
  705.                 local magnitude = (character.Head.Position - v.Position).magnitude
  706.                 if magnitude <= shieldsize then
  707.                     if v.Parent ~= player.Character and v.Name ~= ("ShieldVisual") then
  708.                         if v.Name ~= ("Base") then
  709.                             if v.Name ~= ("Terrain") then
  710.                                 local permissiondenied = 0
  711.                                 for i,m in pairs(PermissionList) do
  712.                                     if v.Parent.Name == m then
  713.                                         permissiondenied = 1
  714.                                     end
  715.                                 end
  716.                                 if permissiondenied == 0 then
  717.                                     v:Destroy()
  718.                                 end
  719.                             end
  720.                         end
  721.                     end
  722.                 end
  723.             end
  724.             if v:IsA("BasePart") == false then
  725.                 for i,w in pairs(v:GetChildren()) do
  726.                     if w:IsA("BasePart") == true then
  727.                         local magnitude = (character.Head.Position - w.Position).magnitude
  728.                         if magnitude <= shieldsize then
  729.                             if w.Parent ~= player.Character and v.Name ~= ("ShieldVisual") then
  730.                                 if w.Name ~= ("Base") then
  731.                                     local permissiondenied = 0
  732.                                     for i,n in pairs(PermissionList) do
  733.                                         if w.Parent.Name == n then
  734.                                             permissiondenied = 1
  735.                                         end
  736.                                     end
  737.                                     if permissiondenied == 0 then
  738.                                         w:Destroy()
  739.                                     end                        
  740.                                 end
  741.                             end
  742.                         end
  743.                     else
  744.                     for i,b in pairs(w:GetChildren()) do
  745.                         if b:IsA("BasePart") == true then
  746.                             local magnitude = (character.Head.Position - b.Position).magnitude
  747.                             if magnitude <= shieldsize then
  748.                                 if b.Parent ~= player.Character and b.Name ~= ("ShieldVisual") then
  749.                                     if b.Name ~= ("Base") then
  750.                                         for i,k in pairs(PermissionList) do
  751.                                             if b.Parent.Name == k then
  752.                                                 permissiondenied = 1
  753.                                             end
  754.                                         end
  755.                                         if permissiondenied == 0 then
  756.                                             b:Destroy()
  757.                                         end
  758.                                     end
  759.                                 end
  760.                             end
  761.                         end
  762.                     end
  763.                 end
  764.             end
  765.         end
  766.     end
  767.  
  768.     --Move and Size Shield Visual
  769.  
  770. game:GetService("UserInputService").InputBegan:connect(function(input)
  771. if input.KeyCode == Enum.KeyCode.LeftShift then
  772. character.Humanoid.WalkSpeed = (100)
  773. end
  774. end)
  775.  
  776. game:GetService("UserInputService").InputBegan:connect(function(input)
  777. if input.KeyCode == Enum.KeyCode.LeftControl then
  778. torso.CFrame = mouse.Hit
  779. end
  780. end)
  781.  
  782. game:GetService("UserInputService").InputEnded:connect(function(input)
  783. if input.KeyCode == Enum.KeyCode.LeftShift then
  784. character.Humanoid.WalkSpeed = (16)
  785. end
  786. end)
  787.  
  788.  
  789.     shieldv.CFrame = character.Head.CFrame
  790.     if shieldv.Size.X <= shieldsize then
  791.         shieldv.Size = shieldv.Size + Vector3.new(shieldsize * shieldgrowrate, shieldsize * shieldgrowrate, shieldsize * shieldgrowrate)
  792.     end
  793.     if shieldv.Size.X >= shieldsize then
  794.         shieldv.Size = shieldv.Size - Vector3.new(shieldv.Size.X * shieldgrowrate, shieldv.Size.Y * shieldgrowrate, shieldv.Size.Z * shieldgrowrate)
  795.     end
  796.     if player.Character == nil then
  797.         shieldv:Destroy()
  798.     end
  799.     if torso == nil then
  800.         shieldv:Destroy()
  801.     end
  802.     if head == nil then
  803.         shieldv:Destroy()
  804.     end
  805.     if character.Humanoid.Health <= 0 then
  806.         shieldv:Destroy()
  807.     end
  808.    
  809.     --platform move
  810.     if hasplatform == 1 then
  811.         character.Platform.CanCollide = false
  812.         character.Platform.Position = torso.Position + Vector3.new(0, -3, 0)
  813.         character.Platform.CanCollide = true
  814.     end
  815.     for i,v in pairs(player.Backpack:GetChildren()) do
  816.         if v.Name == ("HopperBin") then
  817.             v:Destroy()
  818.         end
  819.     end
  820. end
  821. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement