Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ShopInventory (LocalScript in StarterPlayerScripts):
- task.wait(2)
- local player = game.Players.LocalPlayer
- local playerGui = player:WaitForChild("PlayerGui")
- local buyEvent = game.ReplicatedStorage:WaitForChild("BuyEvent")
- local equipEvent = game.ReplicatedStorage:WaitForChild("EquipEvent")
- local KaguneStorageGui = playerGui:WaitForChild("KaguneStorageGUI")
- local KaguneShopGui = playerGui:WaitForChild("KaguneShopGUI")
- local inventoryFrame = KaguneStorageGui:WaitForChild("StorageFrame")
- local scrollingFrame = inventoryFrame:WaitForChild("ScrollingFrame")
- local Kagune1TextLabel = scrollingFrame:WaitForChild("Kagune1")
- local Kagune2TextLabel = scrollingFrame:WaitForChild("Kagune2")
- local Kagune3TextLabel = scrollingFrame:WaitForChild("Kagune3")
- local EquipButton1 = Kagune1TextLabel:WaitForChild("EquipButton")
- local EquipButton2 = Kagune2TextLabel:WaitForChild("EquipButton")
- local EquipButton3 = Kagune3TextLabel:WaitForChild("EquipButton")
- local StorageExitButton = inventoryFrame:WaitForChild("ExitButton")
- local EquippedKaguneTextLabel = inventoryFrame:WaitForChild("EquippedKagune")
- local character = player.Character or player.CharacterAdded:Wait()
- local equipDebounce = false
- local KaguneValue1 = Instance.new("StringValue")
- KaguneValue1.Name = "KaguneValue1"
- KaguneValue1.Value = "None"
- KaguneValue1.Parent = EquipButton1
- local KaguneValue2 = Instance.new("StringValue")
- KaguneValue2.Name = "KaguneValue2"
- KaguneValue2.Value = "None"
- KaguneValue2.Parent = EquipButton2
- local KaguneValue3 = Instance.new("StringValue")
- KaguneValue3.Name = "KaguneValue3"
- KaguneValue3.Value = "None"
- KaguneValue3.Parent = EquipButton3
- EquipButton1.MouseButton1Click:Connect(function(player)
- if equipDebounce then return end
- equipDebounce = true
- task.delay(5, function()
- equipDebounce = false
- end)
- game.ReplicatedStorage:WaitForChild("KaguneValue1"):FireServer(KaguneValue1, Kagune1TextLabel, EquippedKaguneTextLabel)
- game.ReplicatedStorage:WaitForChild("EquipEvent"):FireServer(KaguneValue1.Value, Kagune1TextLabel.Text, EquippedKaguneTextLabel.Text)
- end)
- EquipButton2.MouseButton1Click:Connect(function(player)
- if equipDebounce then return end
- equipDebounce = true
- task.delay(5, function()
- equipDebounce = false
- end)
- game.ReplicatedStorage.KaguneValue2:FireServer(KaguneValue2, EquippedKaguneTextLabel)
- end)
- EquipButton3.MouseButton1Click:Connect(function(player)
- if equipDebounce then return end
- equipDebounce = true
- task.delay(5, function()
- equipDebounce = false
- end)
- game.ReplicatedStorage.KaguneValue3:FireServer(KaguneValue3, EquippedKaguneTextLabel)
- end)
- if player.Character:WaitForChild("EtoV1Kagune").Enabled == true or player.Character:WaitForChild("EtoV2Kagune").Enabled == true then
- repeat EquippedKaguneTextLabel.Text = "Equipped Kagune: Eto" until EquippedKaguneTextLabel.Text == "Equipped Kagune: Eto"
- end
- player.Character:WaitForChild("EtoV1Kagune").Changed:Connect(function()
- repeat EquippedKaguneTextLabel.Text = "Equipped Kagune: Eto" until EquippedKaguneTextLabel.Text == "Equipped Kagune: Eto"
- end)
- if player.Character:WaitForChild("NoroV1Kagune").Enabled == true then
- repeat EquippedKaguneTextLabel.Text = "Equipped Kagune: Noro" until EquippedKaguneTextLabel.Text == "Equipped Kagune: Noro"
- end
- player.Character:WaitForChild("NoroV1Kagune").Changed:Connect(function()
- repeat EquippedKaguneTextLabel.Text = "Equipped Kagune: Noro" until EquippedKaguneTextLabel.Text == "Equipped Kagune: Noro"
- end)
- if player.Character:WaitForChild("KenV1Kagune").Enabled == true or player.Character:WaitForChild("KenV2Kagune").Enabled == true then
- repeat EquippedKaguneTextLabel.Text = "Equipped Kagune: Ken" until EquippedKaguneTextLabel.Text == "Equipped Kagune: Ken"
- end
- player.Character:WaitForChild("KenV1Kagune").Changed:Connect(function()
- repeat EquippedKaguneTextLabel.Text = "Equipped Kagune: Ken" until EquippedKaguneTextLabel.Text == "Equipped Kagune: Ken"
- end)
- game.ReplicatedStorage:WaitForChild("KaguneValue1B").OnClientEvent:Connect(function(weapon)
- if weapon == nil then return end
- task.wait()
- EquippedKaguneTextLabel.Text = "Equipped Kagune: "..weapon
- print("Equipped Kagune: weapon: "..weapon)
- end)
- game.ReplicatedStorage:WaitForChild("EquipEvent2").OnClientEvent:Connect(function(EquippedKaguneTextLabelArg, KaguneValue1Arg, weapon)
- if EquippedKaguneTextLabelArg == "Equipped Kagune: None" then
- KaguneValue1Arg = "None"
- Kagune1TextLabel.Text = "Kagune 1: None"
- elseif EquippedKaguneTextLabelArg == "Equipped Kagune: Noro" then
- KaguneValue1Arg = "Noro"
- Kagune1TextLabel.Text = "Kagune 1: Noro"
- elseif EquippedKaguneTextLabelArg == "Equipped Kagune: Ken" then
- KaguneValue1Arg = "Ken"
- Kagune1TextLabel.Text = "Kagune 1: Ken"
- elseif EquippedKaguneTextLabelArg == "Equipped Kagune: Eto" then
- KaguneValue1Arg = "Eto"
- Kagune1TextLabel.Text = "Kagune 1: Eto"
- end
- if KaguneValue1Arg == "None" then
- task.wait()
- KaguneValue1.Value = weapon
- Kagune1TextLabel.Text = "Kagune 1: "..weapon
- task.wait()
- EquippedKaguneTextLabel.Text = "Equipped Kagune: None"
- elseif KaguneValue1Arg == "Noro" then
- task.wait()
- KaguneValue1.Value = weapon
- Kagune1TextLabel.Text = "Kagune 1: "..weapon
- EquippedKaguneTextLabel.Text = "Equipped Kagune: Noro"
- end
- end)
- game.ReplicatedStorage:WaitForChild("GUIEvent").OnClientEvent:Connect(function(player)
- inventoryFrame.Visible = true
- end)
- StorageExitButton.MouseButton1Click:Connect(function(player)
- inventoryFrame.Visible = false
- end)
Advertisement
Add Comment
Please, Sign In to add comment