Advertisement
Guest User

New Summon Script

a guest
Aug 29th, 2020
2,771
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.76 KB | None | 0 0
  1. local RS = game:GetService("ReplicatedStorage")
  2. local Stand = RS:WaitForChild("Stand")
  3.  
  4. Stand.OnServerEvent:Connect(function(player,active)
  5. if active == false then
  6. local Character = player.Character
  7. local HumanoidRP = Character:WaitForChild("HumanoidRootPart")
  8.  
  9. local Folder = Instance.new("Folder",workspace)
  10. Folder.Name = player.Name.." Stand"
  11.  
  12. local Stands = script:WaitForChild("Dummy"):Clone()
  13. local childs = Stands:GetDescendants()
  14. for i,v in pairs(childs) do
  15. if v:IsA("MeshPart") or v:IsA("Part") and v.Name ~= "HumanoidRootPart" or v:IsA("UnionOperation") then
  16. v.Transparency = 1
  17. local currentMaterial = v.Material
  18. v.Material = Enum.Material.Plastic
  19. delay(0,function()
  20. for i =1,10 do
  21. v.Transparency = v.Transparency -0.1
  22. wait()
  23. end
  24. v.Material = currentMaterial
  25. end)
  26. end
  27. end
  28. Stands.Parent = Folder
  29. Stands:WaitForChild("HumanoidRootPart").CFrame = HumanoidRP.CFrame * CFrame.new(0,0,0)
  30. local S = Stands.HumanoidRootPart.Summon
  31. S:play()
  32.  
  33. local weld = Instance.new("ManualWeld")
  34. weld.Name = "Stand Weld"
  35. weld.Part0 = Stands:WaitForChild("HumanoidRootPart")
  36. weld.Part1 = HumanoidRP
  37. weld.C0 = Stands:WaitForChild("HumanoidRootPart").CFrame:inverse() * HumanoidRP.CFrame
  38. weld.Parent = weld.Part0
  39.  
  40. local animcontrol = Stands:WaitForChild("AnimControl")
  41. local idle = animcontrol:LoadAnimation(script:WaitForChild("Idle"))
  42. idle:Play()
  43.  
  44. end
  45. end)
  46.  
  47. Stand.OnServerEvent:Connect(function(player,active)
  48. if active == true then
  49. local Character = player.Character
  50. local HumanoidRP = Character:WaitForChild("HumanoidRootPart")
  51.  
  52. local stand = workspace:WaitForChild(player.Name.." Stand")
  53.  
  54. local Chils = stand:FindFirstChild("Dummy")
  55. local childs = Chils:GetChildren()
  56. for i,v in pairs(childs) do
  57. if v:IsA("MeshPart") or v:IsA("Part") and v.Name ~= "HumanoidRootPart" or v:IsA("UnionOperation") then
  58. local currentMaterial = v.Material
  59. v.Material = Enum.Material.ForceField
  60. delay(0.2,function()
  61. for i =1,10 do
  62. v.Transparency = v.Transparency +0.1
  63. wait()
  64. end
  65. v.Material = currentMaterial
  66. end)
  67. end
  68. end
  69.  
  70. wait(0.4)
  71. stand:Destroy()
  72.  
  73. Stand:FireClient(player)
  74. end
  75. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement