REDPlays

JoJo Part 5 Scripts

Jan 20th, 2020
6,473
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. --//Server script for Arrow
  2.  
  3. local Arrow = script.Parent
  4. local Click = Arrow:WaitForChild("Click")
  5.  
  6. Click.MouseClick:Connect(function(player)
  7.  
  8. local Backpack = player:FindFirstChild("Backpack")
  9. if Backpack then
  10. local Stands = game:GetService("ServerStorage"):WaitForChild("Stands")
  11.  
  12. local randomStand = math.random(1,3)
  13. if randomStand == 1 then
  14. --Give Stand1
  15. if Backpack:FindFirstChild("Stand1") or Backpack:FindFirstChild("Stand2") or Backpack:FindFirstChild("Stand3") then
  16. local prevStand = workspace:FindFirstChild(player.Name.." Stand")
  17. local prev = Backpack:FindFirstChild("Stand1") or Backpack:FindFirstChild("Stand2") or Backpack:FindFirstChild("Stand3")
  18. prevStand:Destroy()
  19. prev:Destroy()
  20.  
  21. local Stand = Stands:FindFirstChild("Stand1"):Clone()
  22. Stand.Parent = Backpack
  23. else
  24. local Stand = Stands:FindFirstChild("Stand1"):Clone()
  25. Stand.Parent = Backpack
  26. end
  27.  
  28. elseif randomStand == 2 then
  29. --Give Stand2
  30. if Backpack:FindFirstChild("Stand1") or Backpack:FindFirstChild("Stand2") or Backpack:FindFirstChild("Stand3") then
  31. local prevStand = workspace:FindFirstChild(player.Name.." Stand")
  32. local prev = Backpack:FindFirstChild("Stand1") or Backpack:FindFirstChild("Stand2") or Backpack:FindFirstChild("Stand3")
  33. prevStand:Destroy()
  34. prev:Destroy()
  35.  
  36. local Stand = Stands:FindFirstChild("Stand2"):Clone()
  37. Stand.Parent = Backpack
  38. else
  39. local Stand = Stands:FindFirstChild("Stand2"):Clone()
  40. Stand.Parent = Backpack
  41. end
  42.  
  43. elseif randomStand == 3 then
  44. --Give Stand3
  45. if Backpack:FindFirstChild("Stand1") or Backpack:FindFirstChild("Stand2") or Backpack:FindFirstChild("Stand3") then
  46. local prevStand = workspace:FindFirstChild(player.Name.." Stand")
  47. local prev = Backpack:FindFirstChild("Stand1") or Backpack:FindFirstChild("Stand2") or Backpack:FindFirstChild("Stand3")
  48. prevStand:Destroy()
  49. prev:Destroy()
  50.  
  51. local Stand = Stands:FindFirstChild("Stand3"):Clone()
  52. Stand.Parent = Backpack
  53. else
  54. local Stand = Stands:FindFirstChild("Stand3"):Clone()
  55. Stand.Parent = Backpack
  56. end
  57.  
  58. end
  59.  
  60. Arrow:Destroy()
  61. end
  62. end)
Advertisement
Add Comment
Please, Sign In to add comment