Phewru

ShopInventory

Aug 28th, 2026
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.70 KB | None | 0 0
  1. ShopInventory (LocalScript in StarterPlayerScripts):
  2.  
  3.  
  4.  
  5. task.wait(2)
  6.  
  7.  
  8. local player = game.Players.LocalPlayer
  9. local playerGui = player:WaitForChild("PlayerGui")
  10. local buyEvent = game.ReplicatedStorage:WaitForChild("BuyEvent")
  11. local equipEvent = game.ReplicatedStorage:WaitForChild("EquipEvent")
  12. local KaguneStorageGui = playerGui:WaitForChild("KaguneStorageGUI")
  13. local KaguneShopGui = playerGui:WaitForChild("KaguneShopGUI")
  14.  
  15.  
  16. local inventoryFrame = KaguneStorageGui:WaitForChild("StorageFrame")
  17. local scrollingFrame = inventoryFrame:WaitForChild("ScrollingFrame")
  18. local Kagune1TextLabel = scrollingFrame:WaitForChild("Kagune1")
  19. local Kagune2TextLabel = scrollingFrame:WaitForChild("Kagune2")
  20. local Kagune3TextLabel = scrollingFrame:WaitForChild("Kagune3")
  21. local EquipButton1 = Kagune1TextLabel:WaitForChild("EquipButton")
  22. local EquipButton2 = Kagune2TextLabel:WaitForChild("EquipButton")
  23. local EquipButton3 = Kagune3TextLabel:WaitForChild("EquipButton")
  24. local StorageExitButton = inventoryFrame:WaitForChild("ExitButton")
  25. local EquippedKaguneTextLabel = inventoryFrame:WaitForChild("EquippedKagune")
  26.  
  27.  
  28. local character = player.Character or player.CharacterAdded:Wait()
  29.  
  30.  
  31. local equipDebounce = false
  32.  
  33.  
  34. local KaguneValue1 = Instance.new("StringValue")
  35. KaguneValue1.Name = "KaguneValue1"
  36. KaguneValue1.Value = "None"
  37. KaguneValue1.Parent = EquipButton1
  38.  
  39.  
  40. local KaguneValue2 = Instance.new("StringValue")
  41. KaguneValue2.Name = "KaguneValue2"
  42. KaguneValue2.Value = "None"
  43. KaguneValue2.Parent = EquipButton2
  44.  
  45.  
  46. local KaguneValue3 = Instance.new("StringValue")
  47. KaguneValue3.Name = "KaguneValue3"
  48. KaguneValue3.Value = "None"
  49. KaguneValue3.Parent = EquipButton3
  50.  
  51.  
  52. EquipButton1.MouseButton1Click:Connect(function(player)
  53.  
  54. if equipDebounce then return end
  55.  
  56. equipDebounce = true
  57.  
  58. task.delay(5, function()
  59. equipDebounce = false
  60. end)
  61.  
  62. game.ReplicatedStorage:WaitForChild("KaguneValue1"):FireServer(KaguneValue1, Kagune1TextLabel, EquippedKaguneTextLabel)
  63.  
  64. game.ReplicatedStorage:WaitForChild("EquipEvent"):FireServer(KaguneValue1.Value, Kagune1TextLabel.Text, EquippedKaguneTextLabel.Text)
  65.  
  66. end)
  67.  
  68.  
  69. EquipButton2.MouseButton1Click:Connect(function(player)
  70.  
  71. if equipDebounce then return end
  72.  
  73. equipDebounce = true
  74.  
  75. task.delay(5, function()
  76. equipDebounce = false
  77. end)
  78.  
  79. game.ReplicatedStorage.KaguneValue2:FireServer(KaguneValue2, EquippedKaguneTextLabel)
  80.  
  81. end)
  82.  
  83.  
  84. EquipButton3.MouseButton1Click:Connect(function(player)
  85.  
  86. if equipDebounce then return end
  87.  
  88. equipDebounce = true
  89.  
  90. task.delay(5, function()
  91. equipDebounce = false
  92. end)
  93.  
  94. game.ReplicatedStorage.KaguneValue3:FireServer(KaguneValue3, EquippedKaguneTextLabel)
  95.  
  96. end)
  97.  
  98.  
  99. if player.Character:WaitForChild("EtoV1Kagune").Enabled == true or player.Character:WaitForChild("EtoV2Kagune").Enabled == true then
  100.  
  101. repeat EquippedKaguneTextLabel.Text = "Equipped Kagune: Eto" until EquippedKaguneTextLabel.Text == "Equipped Kagune: Eto"
  102.  
  103. end
  104.  
  105.  
  106. player.Character:WaitForChild("EtoV1Kagune").Changed:Connect(function()
  107.  
  108. repeat EquippedKaguneTextLabel.Text = "Equipped Kagune: Eto" until EquippedKaguneTextLabel.Text == "Equipped Kagune: Eto"
  109.  
  110. end)
  111.  
  112.  
  113. if player.Character:WaitForChild("NoroV1Kagune").Enabled == true then
  114.  
  115. repeat EquippedKaguneTextLabel.Text = "Equipped Kagune: Noro" until EquippedKaguneTextLabel.Text == "Equipped Kagune: Noro"
  116.  
  117. end
  118.  
  119.  
  120. player.Character:WaitForChild("NoroV1Kagune").Changed:Connect(function()
  121.  
  122. repeat EquippedKaguneTextLabel.Text = "Equipped Kagune: Noro" until EquippedKaguneTextLabel.Text == "Equipped Kagune: Noro"
  123.  
  124. end)
  125.  
  126.  
  127. if player.Character:WaitForChild("KenV1Kagune").Enabled == true or player.Character:WaitForChild("KenV2Kagune").Enabled == true then
  128.  
  129. repeat EquippedKaguneTextLabel.Text = "Equipped Kagune: Ken" until EquippedKaguneTextLabel.Text == "Equipped Kagune: Ken"
  130.  
  131. end
  132.  
  133.  
  134. player.Character:WaitForChild("KenV1Kagune").Changed:Connect(function()
  135.  
  136. repeat EquippedKaguneTextLabel.Text = "Equipped Kagune: Ken" until EquippedKaguneTextLabel.Text == "Equipped Kagune: Ken"
  137.  
  138. end)
  139.  
  140.  
  141. game.ReplicatedStorage:WaitForChild("KaguneValue1B").OnClientEvent:Connect(function(weapon)
  142.  
  143. if weapon == nil then return end
  144.  
  145. task.wait()
  146.  
  147. EquippedKaguneTextLabel.Text = "Equipped Kagune: "..weapon
  148.  
  149. print("Equipped Kagune: weapon: "..weapon)
  150.  
  151. end)
  152.  
  153.  
  154. game.ReplicatedStorage:WaitForChild("EquipEvent2").OnClientEvent:Connect(function(EquippedKaguneTextLabelArg, KaguneValue1Arg, weapon)
  155.  
  156. if EquippedKaguneTextLabelArg == "Equipped Kagune: None" then
  157.  
  158. KaguneValue1Arg = "None"
  159.  
  160. Kagune1TextLabel.Text = "Kagune 1: None"
  161.  
  162. elseif EquippedKaguneTextLabelArg == "Equipped Kagune: Noro" then
  163.  
  164. KaguneValue1Arg = "Noro"
  165.  
  166. Kagune1TextLabel.Text = "Kagune 1: Noro"
  167.  
  168. elseif EquippedKaguneTextLabelArg == "Equipped Kagune: Ken" then
  169.  
  170. KaguneValue1Arg = "Ken"
  171.  
  172. Kagune1TextLabel.Text = "Kagune 1: Ken"
  173.  
  174. elseif EquippedKaguneTextLabelArg == "Equipped Kagune: Eto" then
  175.  
  176. KaguneValue1Arg = "Eto"
  177.  
  178. Kagune1TextLabel.Text = "Kagune 1: Eto"
  179.  
  180. end
  181.  
  182. if KaguneValue1Arg == "None" then
  183.  
  184. task.wait()
  185.  
  186. KaguneValue1.Value = weapon
  187.  
  188. Kagune1TextLabel.Text = "Kagune 1: "..weapon
  189.  
  190. task.wait()
  191.  
  192. EquippedKaguneTextLabel.Text = "Equipped Kagune: None"
  193.  
  194. elseif KaguneValue1Arg == "Noro" then
  195.  
  196. task.wait()
  197.  
  198. KaguneValue1.Value = weapon
  199.  
  200. Kagune1TextLabel.Text = "Kagune 1: "..weapon
  201.  
  202. EquippedKaguneTextLabel.Text = "Equipped Kagune: Noro"
  203.  
  204. end
  205.  
  206. end)
  207.  
  208.  
  209. game.ReplicatedStorage:WaitForChild("GUIEvent").OnClientEvent:Connect(function(player)
  210.  
  211. inventoryFrame.Visible = true
  212.  
  213. end)
  214.  
  215.  
  216. StorageExitButton.MouseButton1Click:Connect(function(player)
  217.  
  218. inventoryFrame.Visible = false
  219.  
  220. end)
  221.  
  222.  
Advertisement
Add Comment
Please, Sign In to add comment