REDPlays

JoJo Part 7 Scripts

Jan 20th, 2020
5,686
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.17 KB | None | 0 0
  1. --//Server script for Stand Updater
  2.  
  3. local ServerStorage = game:GetService("ServerStorage")
  4.  
  5. game.Players.PlayerAdded:Connect(function(Player)
  6.  
  7. local PlrStats = Instance.new("Folder",Player)
  8. PlrStats.Name = "PlrStats"
  9.  
  10. local Stand = Instance.new("StringValue",PlrStats)
  11. Stand.Name = "Stand"
  12. Stand.Value = ""
  13.  
  14. Player.CharacterAdded:Connect(function(Character)
  15. if Stand.Value ~= nil then
  16. local stands = ServerStorage:WaitForChild("Stands")
  17.  
  18. local standToFind = stands:FindFirstChild(Stand.Value)
  19. if standToFind then
  20. local newStand = standToFind:Clone()
  21. newStand.Parent = Player.Backpack
  22.  
  23. end
  24. end
  25. end)
  26. end)
  27.  
  28. --//Arrow Script
  29.  
  30. local Arrow = script.Parent
  31. local Click = Arrow:WaitForChild("Click")
  32.  
  33. Click.MouseClick:Connect(function(player)
  34.  
  35. local Backpack = player:FindFirstChild("Backpack")
  36. if Backpack then
  37. local Stands = game:GetService("ServerStorage"):WaitForChild("Stands")
  38.  
  39. local PlrStats = player:WaitForChild("PlrStats")
  40. local currentStand = PlrStats:WaitForChild("Stand")
  41.  
  42. local randomStand = math.random(1,3)
  43. if randomStand == 1 then
  44. --Give Stand1
  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("Stand1"):Clone()
  52. Stand.Parent = Backpack
  53.  
  54. currentStand.Value = "Stand1"
  55. else
  56. local Stand = Stands:FindFirstChild("Stand1"):Clone()
  57. Stand.Parent = Backpack
  58.  
  59. currentStand.Value = "Stand1"
  60. end
  61.  
  62. elseif randomStand == 2 then
  63. --Give Stand2
  64. if Backpack:FindFirstChild("Stand1") or Backpack:FindFirstChild("Stand2") or Backpack:FindFirstChild("Stand3") then
  65. local prevStand = workspace:FindFirstChild(player.Name.." Stand")
  66. local prev = Backpack:FindFirstChild("Stand1") or Backpack:FindFirstChild("Stand2") or Backpack:FindFirstChild("Stand3")
  67. prevStand:Destroy()
  68. prev:Destroy()
  69.  
  70. local Stand = Stands:FindFirstChild("Stand2"):Clone()
  71. Stand.Parent = Backpack
  72.  
  73. currentStand.Value = "Stand2"
  74. else
  75. local Stand = Stands:FindFirstChild("Stand2"):Clone()
  76. Stand.Parent = Backpack
  77.  
  78. currentStand.Value = "Stand2"
  79. end
  80.  
  81. elseif randomStand == 3 then
  82. --Give Stand3
  83. if Backpack:FindFirstChild("Stand1") or Backpack:FindFirstChild("Stand2") or Backpack:FindFirstChild("Stand3") then
  84. local prevStand = workspace:FindFirstChild(player.Name.." Stand")
  85. local prev = Backpack:FindFirstChild("Stand1") or Backpack:FindFirstChild("Stand2") or Backpack:FindFirstChild("Stand3")
  86. prevStand:Destroy()
  87. prev:Destroy()
  88.  
  89. local Stand = Stands:FindFirstChild("Stand3"):Clone()
  90. Stand.Parent = Backpack
  91.  
  92. currentStand.Value = "Stand3"
  93. else
  94. local Stand = Stands:FindFirstChild("Stand3"):Clone()
  95. Stand.Parent = Backpack
  96.  
  97. currentStand.Value = "Stand3"
  98. end
  99.  
  100. end
  101.  
  102. Arrow:Destroy()
  103. end
  104. end)
Advertisement
Add Comment
Please, Sign In to add comment