Advertisement
urabigfatnoob

shield

Sep 13th, 2015
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 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. local mesh = Instance.new("SpecialMesh",shield)
  15. mesh.MeshType = "Sphere"
  16.  
  17. mouse.KeyDown:connect(function(key)
  18. if key == 't' then
  19. chr.Humanoid.WalkSpeed = 0
  20. clone = shield:Clone()
  21. clone.Parent = workspace
  22. clone.CFrame = chr.Torso.CFrame
  23.  
  24. clone.Touched:connect(function(p)
  25. if p and p.ClassName == "Part" and p.Locked == false then
  26. p:Destroy()
  27. end
  28. end)
  29. for i = 1,30 do
  30. game:GetService('RunService').RenderStepped:wait()
  31. clone.Size = clone.Size + Vector3.new(.2,.2,.2)
  32. clone.CFrame = chr.Torso.CFrame
  33. end
  34. end
  35. end)
  36.  
  37. mouse.KeyUp:connect(function(key)
  38. if key == 't' then
  39. chr.Humanoid.WalkSpeed = 16
  40. for i = 1,30 do
  41. game:GetService('RunService').RenderStepped:wait()
  42. clone.Size = clone.Size - Vector3.new(.2,.2,.2)
  43. clone.CFrame = chr.Torso.CFrame
  44. end
  45. clone:Destroy()
  46. end
  47. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement