REDPlays

JoJo Part 1 Scripts

Jan 20th, 2020
53,858
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. --//Local Script for Summon
  2.  
  3. local Player = game.Players.LocalPlayer
  4.  
  5. local rp = game:GetService("ReplicatedStorage")
  6. local Stand = rp:WaitForChild("Stand")
  7.  
  8. local UIS = game:GetService("UserInputService")
  9.  
  10. local debounce = false
  11. local active = false
  12.  
  13. UIS.InputBegan:Connect(function(input,isTyping)
  14. if isTyping then
  15. return
  16. elseif input.KeyCode == Enum.KeyCode.E then
  17. if debounce == false and active == false then
  18. debounce = true
  19.  
  20. Stand:FireServer(active)
  21. end
  22. end
  23. end)
  24.  
  25. UIS.InputBegan:Connect(function(input,isTyping)
  26. if isTyping then
  27. return
  28. elseif input.KeyCode == Enum.KeyCode.E then
  29. if debounce == true and active == false then
  30. active = true
  31.  
  32. Stand:FireServer(active)
  33. end
  34. end
  35. end)
  36.  
  37. Stand.OnClientEvent:Connect(function()
  38. wait(1)
  39. debounce = false
  40. active = false
  41. end)
  42.  
  43. --//Server Script for Summon
  44.  
  45. local rp = game:GetService("ReplicatedStorage")
  46. local Stand = rp:WaitForChild("Stand")
  47.  
  48. Stand.OnServerEvent:Connect(function(player,active)
  49. if active == false then
  50. local Character = player.Character
  51. local HumanoidRP = Character:WaitForChild("HumanoidRootPart")
  52.  
  53. local Folder = Instance.new("Folder",workspace)
  54. Folder.Name = player.Name.." Stand"
  55.  
  56. local Mystand = script:WaitForChild("Dummy"):Clone()
  57. Mystand.Parent = Folder
  58. Mystand:WaitForChild("HumanoidRootPart").CFrame = HumanoidRP.CFrame * CFrame.new(2,0,2)
  59.  
  60. local animControl = Mystand:WaitForChild("AnimControl")
  61. local idle = animControl:LoadAnimation(script:WaitForChild("Idle"))
  62. idle:Play()
  63.  
  64. local weld = Instance.new("ManualWeld")
  65. weld.Name = "Stand Weld"
  66. weld.Part0 = Mystand:WaitForChild("HumanoidRootPart")
  67. weld.Part1 = HumanoidRP
  68. weld.C0 = Mystand:WaitForChild("HumanoidRootPart").CFrame:inverse() * HumanoidRP.CFrame
  69. weld.Parent = weld.Part0
  70.  
  71. end
  72. end)
  73.  
  74. Stand.OnServerEvent:Connect(function(player,active)
  75. if active == true then
  76. local Character = player.Character
  77. local HumanoidRP = Character:WaitForChild("HumanoidRootPart")
  78.  
  79. local myStand = workspace:WaitForChild(player.Name.." Stand")
  80. myStand:Destroy()
  81.  
  82. Stand:FireClient(player)
  83. end
  84. end)
Advertisement
Add Comment
Please, Sign In to add comment