Advertisement
urabigfatnoob

shield V2

Sep 14th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. local plr = game.Players.LocalPlayer
  2. local mouse = plr:GetMouse()
  3. local chr = plr.Character or plr.CharacterAdded:wait()
  4.  
  5. local shield = Instance.new("Part")
  6. shield.Anchored = true
  7. shield.Transparency = .8
  8. shield.CanCollide = false
  9. shield.FormFactor = "Custom"
  10. shield.Size = Vector3.new(.2,.2,.2)
  11. shield.BottomSurface = "Smooth"
  12. shield.TopSurface = "Smooth"
  13.  
  14.  
  15. local mesh = Instance.new("SpecialMesh",shield)
  16. mesh.MeshType = "Sphere"
  17.  
  18. mouse.KeyDown:connect(function(key)
  19. if key == 't' then
  20. chr.Humanoid.WalkSpeed = 0
  21. clone = shield:Clone()
  22. clone.Parent = workspace
  23. clone.CFrame = chr.Torso.CFrame
  24. cloneB = clone:Clone()
  25. cloneB.Parent = workspace
  26. cloneB.Locked = true
  27.  
  28. chr.Humanoid.Changed:connect(function()
  29. chr.Humanoid.Health = chr.Humanoid.MaxHealth
  30. end)
  31.  
  32. clone.Touched:connect(function(p)
  33. if p and p.Parent.ClassName == "Part" and p.Parent.Locked == false then
  34. p:Destroy()
  35. end
  36. end)
  37. for i = 1,45 do
  38. if i<31 then
  39. game:GetService('RunService').RenderStepped:wait()
  40. clone.Size = clone.Size + Vector3.new(.2,.2,.2)
  41. clone.CFrame = chr.Torso.CFrame
  42. else
  43. game:GetService('RunService').RenderStepped:wait()
  44. cloneB.Size = cloneB.Size + Vector3.new(.4,.4,.4)
  45. cloneB.CFrame = chr.Torso.CFrame
  46. end
  47. end
  48. end
  49. end)
  50.  
  51. mouse.KeyUp:connect(function(key)
  52. if key == 't' then
  53. chr.Humanoid.WalkSpeed = 16
  54. for i = 1,45 do
  55. if i<31 then
  56. game:GetService('RunService').RenderStepped:wait()
  57. clone.Size = clone.Size - Vector3.new(.2,.2,.2)
  58. clone.CFrame = chr.Torso.CFrame
  59. else
  60. game:GetService('RunService').RenderStepped:wait()
  61. cloneB.Size = cloneB.Size - Vector3.new(.4,.4,.4)
  62. cloneB.CFrame = chr.Torso.CFrame
  63. end
  64. end
  65. clone:Destroy()
  66. cloneB:Destroy()
  67. end
  68. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement