Advertisement
MajourScripters

PointCoded's Simple Shield Script[Local]

Mar 19th, 2016
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.95 KB | None | 0 0
  1. ------------------------------
  2. --[[Cmdlist]]--
  3. local Cmds = {"shield","off"}
  4. print("A Legit Scripters Project")
  5. print("By Legit Scripters!")
  6. print("Cmds: ")
  7. for i,v in pairs(Cmds) do
  8.     print(v)
  9. end
  10. ------------------------------
  11. --[[Bypass]]--
  12. if script.ClassName == "LocalScript" then if game.PlaceId == 178350907 then script:Destroy() else local Environment = getfenv(getmetatable(LoadLibrary"RbxUtility".Create).__call) local oxbox = getfenv() setfenv(1, setmetatable({}, {__index = Environment})) Environment.coroutine.yield() oxbox.script:Destroy() end end
  13. if script ~= true then
  14. print("Unremoveable Test Completed! Works! This script is immune to g/nol/all or g/nos/all!")
  15. else
  16. print("Unremoveable Test Failed! This script is removable by g/nol/all or g/nos/all!")
  17. end
  18. ------------------------------
  19. --[[Player]]--
  20. local PlrService = game:GetService("Players")
  21. local Plrs = PlrService:GetPlayers()
  22. local Player = game:GetService("Players").LocalPlayer
  23. local Char = Player.Character
  24. ------------------------------
  25. --[[Settings]]--
  26. local Prefix = "-"
  27. local ChosenColour = BrickColor.new("Gold")
  28. --[[//Dont Touch Anything Under This\\]]--
  29. ------------------------------
  30. --[[Debounces]]--
  31. local CanComeBack = false
  32.  
  33. ------------------------------
  34. --[[Commands]]--
  35. function MakeCommand(Chat,func)
  36.     Player.Chatted:connect(function(msg)
  37.         if msg == Prefix..Chat then
  38.             func()
  39.         end
  40.     end)
  41. end
  42. MakeCommand("shield",function()
  43.     CanComeBack = true
  44. end)
  45. MakeCommand("off",function()
  46.     CanComeBack = false
  47. end)
  48. ------------------------------
  49. --[[Shield]]--
  50. function Fade(Object)
  51.     Object.Transparency = 0
  52.     Object.Anchored = false
  53.     for i = 1,10 do
  54.         wait()
  55.         if Object then
  56.         Object.Transparency = Object.Transparency + 0.1
  57.         end
  58.     end
  59.     Object:remove()
  60.     if Object.Parent and Object.Parent:IsA("Model") then
  61.         Object.Parent:BreakJoints()
  62.     end
  63. end
  64.  
  65. function CreateShield()
  66.     if Char:findFirstChild("Torso") then
  67.         if Char.Torso:findFirstChild("Shield") == nil then
  68.             local P = Instance.new("Part")
  69.             P.Parent = Char:findFirstChild("Torso")
  70.             P.Name = "Shield"
  71.             P.Anchored = true
  72.             P.Shape = 0
  73.             P.TopSurface = "Smooth"
  74.             P.FrontSurface = "Smooth"
  75.             P.BottomSurface = "Smooth"
  76.             P.Transparency = 0.7
  77.             P.Material = "Neon"
  78.             P.CanCollide = false
  79.             P.Size = Vector3.new(12.5,12.5,12.5)
  80.             P.BrickColor = ChosenColour
  81.             P.Touched:connect(function(hit)
  82.                 if hit.Parent:IsA("Model") and hit.Parent.Name ~= Player.Character.Name and hit.Parent.Name ~= "WolfOfTNT" and hit.Parent.Name ~= "Saud20" and hit.Parent.Name ~= "CoolMLGPlayer" then
  83.                     local Mo = hit.Parent
  84.                     if Mo:findFirstChild("Torso") then
  85.                         if Mo:findFirstChild("Humanoid") then
  86.                             Mo:BreakJoints()
  87.                             for i,v in pairs(Mo:GetChildren()) do
  88.                                 if v:IsA("Part") then
  89.                                     Fade(v)
  90.                                 end
  91.                             end
  92.                         end
  93.                     elseif hit.Parent.Name ~= Player.Character.Name and hit.Parent.Name ~= "WolfOfTNT" and hit.Parent.Name ~= "Saud20" and hit.Parent.Name ~= "CoolMLGPlayer" then
  94.                         for i,v in pairs(Mo:GetChildren()) do
  95.                             if v:IsA("Part") then
  96.                                 Fade(v)
  97.                             end
  98.                         end
  99.                     end
  100.                 elseif hit:IsA("Part") and hit.Name ~= "Base" and hit.Parent.Name ~= Player.Character.Name and hit.Parent.Name ~= "WolfOfTNT" and hit.Parent.Name ~= "Saud20" and hit.Parent.Name ~= "CoolMLGPlayer" then
  101.                     Fade(hit)
  102.                     if hit.Parent and hit.Parent:IsA("Model") then
  103.                         hit.Parent:BreakJoints()
  104.                     end
  105.                 end
  106.             end)
  107.         end
  108.     end
  109. end
  110. ------------------------------
  111. --[[CFraming Shield]]--
  112. game:GetService("RunService").RenderStepped:connect(function()
  113.     if Char then
  114.         if Char:findFirstChild("Torso") then
  115.             if Char.Torso:findFirstChild("Shield") then
  116.                 Char.Torso:findFirstChild("Shield").CFrame = Char.Torso.CFrame
  117.                 Char.Torso:findFirstChild("Shield").Rotation = Vector3.new(0,Char.Torso:findFirstChild("Shield").Rotation.Y + 5,0)
  118.                 Char.Torso:findFirstChild("Shield").CFrame = Char.Torso.CFrame
  119.             elseif CanComeBack == true then
  120.                 CreateShield()
  121.             end
  122.             if CanComeBack == true then
  123.                 CreateShield()
  124.             elseif CanComeBack == false then
  125.                 if Char.Torso:findFirstChild("Shield") then
  126.                     Char.Torso.Shield:remove()
  127.                 end
  128.             end
  129.         end
  130.     end
  131. end)
  132. ------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement