Advertisement
plytalent

shield load on touch

Nov 7th, 2019
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. wait(2)
  2. plr=game:GetService("Players").plytalent
  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)
  21. if plrhit then
  22. print(plrhit.Name)
  23. plrhit:LoadCharacter()
  24. end
  25. end
  26. end)
  27. end
  28. if v:FindFirstChildOfClass("SpecialMesh") then
  29. v:FindFirstChildOfClass("SpecialMesh"):Clone().Parent=shield
  30. end
  31. end
  32. end
  33. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement