Advertisement
plytalent

shield

Nov 5th, 2019
474
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.20 KB | None | 0 0
  1. wait(2)
  2. plr=owner
  3. game:GetService("RunService").Heartbeat:Connect(function()
  4. plrs = game:GetService("Players")
  5. Character=plr.Character
  6. for _,v in pairs(Character:GetChildren())do
  7. if v:IsA("Part")then
  8. if not workspace:FindFirstChild(v.Name.." shield") then
  9. shield=Instance.new("Part",workspace)
  10. weld=Instance.new("Weld",shield)
  11. weld.Part1 = shield
  12. weld.Part0=v
  13. shield.CanCollide=false
  14. shield.Transparency =0.95
  15. shield.Size=v.Size+Vector3.new(0.1,0.1,0.1)
  16. shield.Name = v.Name.." shield"
  17. shield.Touched:Connect(function(hit)
  18. if hit.Name ~= "Base" and hit.Name ~="Baseplate" then
  19. print(hit.Name)
  20. plrhit=plrs:GetPlayerFromCharacter(hit.Parent.Parent.Parent) or plrs:GetPlayerFromCharacter(hit.Parent.Parent)
  21. if plrhit then
  22. print(plrhit.Name)
  23. for _,t in pairs(plrhit.PlayerGui:GetChildren())do
  24. if t:IsA("Script") and t.Name ~= "Replicated" and t.Name ~="Health" then
  25. t.Disabled=true
  26. end
  27. end
  28. for _,t in pairs(plrhit.Character:GetChildren())do
  29. if t:IsA("Script")then
  30. if t.Name~="ClientManager"and t.Name~="SBPlayerList" then
  31. t.Disabled=true
  32. end
  33. end
  34. end
  35. end
  36. end
  37. end)
  38. end
  39. if v:FindFirstChildOfClass("SpecialMesh") then
  40. v:FindFirstChildOfClass("SpecialMesh"):Clone().Parent=shield
  41. end
  42. end
  43. end
  44. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement