Advertisement
qsenko1

TrailShopServerScript

Apr 25th, 2021
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 56.33 KB | None | 0 0
  1. -- Variables
  2. local debounce = true
  3. local dataStore = game:GetService("DataStoreService"):GetDataStore("TrailShop(1)")
  4. local Snowtrail = game.ReplicatedStorage.Trails:FindFirstChild("Snow")
  5. local Redtrail = game.ReplicatedStorage.Trails:FindFirstChild("Red")
  6. local Limetrail = game.ReplicatedStorage.Trails:FindFirstChild("Lime")
  7. local Bluetrail = game.ReplicatedStorage.Trails:FindFirstChild("Blue")
  8. local Pinktrail = game.ReplicatedStorage.Trails:FindFirstChild("Pink")
  9. local Orangetrail = game.ReplicatedStorage.Trails:FindFirstChild("Orange")
  10. local Purpletrail = game.ReplicatedStorage.Trails:FindFirstChild("Purple")
  11. local Yellowtrail = game.ReplicatedStorage.Trails:FindFirstChild("Yellow")
  12. local Diamondtrail = game.ReplicatedStorage.Trails:FindFirstChild("Diamond")
  13. local Darktrail = game.ReplicatedStorage.Trails:FindFirstChild("Dark")
  14. local Rainbowtrail = game.ReplicatedStorage.Trails:FindFirstChild("Rainbow")
  15. local Helltrail = game.ReplicatedStorage.Trails:FindFirstChild("Hell")
  16. local Demontrail = game.ReplicatedStorage.Trails:FindFirstChild("Demon")
  17. local Crimsontrail = game.ReplicatedStorage.Trails:FindFirstChild("Crimson")
  18. local Wavestrail = game.ReplicatedStorage.Trails:FindFirstChild("Waves")
  19. local Reapertrail = game.ReplicatedStorage.Trails:FindFirstChild("Reaper")
  20. local Ghoultrail = game.ReplicatedStorage.Trails:FindFirstChild("Ghoul")
  21. local Dragontrail = game.ReplicatedStorage.Trails:FindFirstChild("Dragon")
  22. local Voidtrail = game.ReplicatedStorage.Trails:FindFirstChild("Void")
  23. local Foxtrail = game.ReplicatedStorage.Trails:FindFirstChild("Fox")
  24. local Kyuubitrail = game.ReplicatedStorage.Trails:FindFirstChild("Kyuubi")
  25. local NineTailstrail = game.ReplicatedStorage.Trails:FindFirstChild("NineTails")
  26. local Juubitrail = game.ReplicatedStorage.Trails:FindFirstChild("Juubi")
  27. local MadaraJuubitrail = game.ReplicatedStorage.Trails:FindFirstChild("Madara&Juubi")
  28. local ObitoMadaratrail = game.ReplicatedStorage.Trails:FindFirstChild("Obito&Madara")
  29. local Aizentrail = game.ReplicatedStorage.Trails:FindFirstChild("Aizen")
  30. local VastoLordtrail = game.ReplicatedStorage.Trails:FindFirstChild("VastoLord")
  31. local Gokutrail = game.ReplicatedStorage.Trails:FindFirstChild("Goku")
  32. local OnePunchtrail = game.ReplicatedStorage.Trails:FindFirstChild("OnePunch")
  33. local Kratostrail = game.ReplicatedStorage.Trails:FindFirstChild("Kratos")
  34. local DoomSlayertrail = game.ReplicatedStorage.Trails:FindFirstChild("DoomSlayer")
  35. local NamelessKingtrail = game.ReplicatedStorage.Trails:FindFirstChild("NamelessKing")
  36. local Solairetrail = game.ReplicatedStorage.Trails:FindFirstChild("Solaire")
  37. local Spongebobtrail = game.ReplicatedStorage.Trails:FindFirstChild("Spongebob")
  38. local Mariotrail = game.ReplicatedStorage.Trails:FindFirstChild("Mario")
  39. -- Functions
  40.  
  41. local function EquipTrail(plr,trail)
  42.     local char = plr.Character
  43.    
  44.     if trail ~= nil and char ~= nil then
  45.        
  46.         if char.HumanoidRootPart:FindFirstChild("Attachment") then char.HumanoidRootPart.Attachment:Destroy() end
  47.         if char.Head:FindFirstChild("Attachment") then char.Head.Attachment:Destroy() end
  48.        
  49.         if char:FindFirstChild(plr.Name.."'s Trail") then char[plr.Name.."'s Trail"]:Destroy() end
  50.        
  51.         trail.Name = plr.Name.."'s Trail"
  52.        
  53.         local attachment1 = Instance.new("Attachment",char:FindFirstChild("HumanoidRootPart"))
  54.         local attachment2 = Instance.new("Attachment",char:FindFirstChild("Head"))
  55.        
  56.         trail.Attachment0 = attachment1
  57.         trail.Attachment1 = attachment2
  58.        
  59.         trail.Parent = char
  60.     end
  61. end
  62.  
  63. -- Player Joins
  64.  
  65. game.Players.PlayerAdded:Connect(function(player)
  66.    
  67.     -- Stats for the player
  68.     local trailInventory = Instance.new("Folder",player); trailInventory.Name = "TrailInventory"
  69.     local equippedTrail = Instance.new("StringValue",player); equippedTrail.Name = "EquippedTrail"
  70.    
  71.     -- Player's character added to the game
  72.    
  73.     player.CharacterAdded:Connect(function(char)
  74.    
  75.         if game.ReplicatedStorage.Trails:FindFirstChild(equippedTrail.Value) then
  76.             EquipTrail(player,game.ReplicatedStorage.Trails:FindFirstChild(equippedTrail.Value):Clone())
  77.         end
  78.     end)
  79.    
  80.     -- If the equipped Value changed, it will get their trail
  81.     equippedTrail.Changed:Connect(function()
  82.         if equippedTrail.Value ~= nil then
  83.             if game.ReplicatedStorage.Trails:FindFirstChild(equippedTrail.Value) then
  84.                 EquipTrail(player,game.ReplicatedStorage.Trails:FindFirstChild(equippedTrail.Value):Clone())
  85.             end
  86.         end
  87.         if equippedTrail.Value == "" then
  88.            
  89.             local char = player.Character
  90.            
  91.             local root = char:FindFirstChild("HumanoidRootPart")
  92.             local head = char:FindFirstChild("Head")
  93.            
  94.             if root:FindFirstChild("Attachment") then root.Attachment:Destroy() end
  95.             if head:FindFirstChild("Attachment") then head.Attachment:Destroy() end
  96.  
  97.             if char:FindFirstChild(player.Name.."'s Trail") then char[player.Name.."'s Trail"]:Destroy() end
  98.         end
  99.     end)
  100.    
  101.     -- loaded up the data
  102.  
  103.     local data
  104.  
  105.     local success, errorMsg = pcall(function()
  106.         data = dataStore:GetAsync(player.UserId)
  107.     end)
  108.  
  109.     if data ~= nil then
  110.         if data.EquippedTrail then
  111.             equippedTrail.Value = data.EquippedTrail
  112.         end
  113.         if data.Trails then
  114.             for index,trail in pairs(data.Trails) do
  115.                 local bool = Instance.new("BoolValue",trailInventory); bool.Name = trail
  116.             end
  117.         end
  118.     else
  119.         -- New player
  120.         print("A new challenger approch")
  121.     end
  122.  
  123.     -- This event will fire the client to update the gui
  124.     game.ReplicatedStorage.Events.SendData:FireClient(player,data)
  125. end)
  126.  
  127. game.Players.PlayerRemoving:Connect(function(player)
  128.     -- Data holder
  129.     local data = {}
  130.    
  131.     data.EquippedTrail = player.EquippedTrail.Value
  132.    
  133.     data.Trails = {}
  134.    
  135.     for i,v in pairs(player.TrailInventory:GetChildren()) do
  136.         table.insert(data.Trails,v.Name)
  137.     end
  138.    
  139.     local success, errorMsg = pcall(function()
  140.         dataStore:SetAsync(player.UserId,data)
  141.     end)
  142.    
  143.     -- if its succeed then the data is saved else we got an error
  144.    
  145.     if success then
  146.         print("Trails Succesfully saved")
  147.     else
  148.         print(errorMsg)
  149.     end
  150.    
  151. end)
  152.  
  153. game:BindToClose(function()
  154.     for index, player in pairs(game.Players:GetPlayers()) do
  155.         local data = {}
  156.  
  157.         data.EquippedTrail = player.EquippedTrail.Value
  158.  
  159.         data.Trails = {}
  160.  
  161.         for i,v in pairs(player.TrailInventory:GetChildren()) do
  162.             table.insert(data.Trails,v.Name)
  163.         end
  164.  
  165.         local success, errorMsg = pcall(function()
  166.             dataStore:SetAsync(player.UserId,data)
  167.         end)
  168.  
  169.         -- if its succeed then the data is saved else we got an error
  170.  
  171.         if success then
  172.             print("Succesfully saved")
  173.         else
  174.             print(errorMsg)
  175.         end
  176.     end
  177. end)
  178.  
  179. -- Server Events
  180.                                                                    
  181. game.ReplicatedStorage.Events.BuyItem1.OnServerInvoke = function(player, SnowtrailName)
  182.     if debounce == true then
  183.         debounce = false
  184.     --print("RemoteFunction fired")
  185.     local ifsInInventory
  186.    
  187.     if player.TrailInventory:FindFirstChild("Snow") then
  188.         ifsInInventory = true
  189.     end    
  190.    
  191.     if Snowtrail then
  192.         if Snowtrail:FindFirstChild("Price") then
  193.             if not ifsInInventory then
  194.                 -- Check if we can buy the trail
  195.                 if player.leaderstats.Coins.Value >= Snowtrail.Price.Value then
  196.                     print(player.Name.." brought the ".. Snowtrail.Name.." trail")
  197.  
  198.                     player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Snowtrail.Price.Value
  199.  
  200.                     local bool = Instance.new("BoolValue",player.TrailInventory); bool.Name = Snowtrail.Name
  201.                
  202.                     return "Brought"
  203.                 else
  204.                     return "NotEnough"     
  205.                 end
  206.                 else
  207.                 -- You already owned it
  208.                  if player.EquippedTrail.Value ~= Snowtrail.Name and ifsInInventory then                                           
  209.                     player.EquippedTrail.Value = Snowtrail.Name
  210.                     --print(player.Name.." equipped the ".. Snowtrail.Name.." trail")  
  211.                     wait(1)
  212.                     debounce = true
  213.                     return "Equip"                                                                             
  214.                 else
  215.                     player.EquippedTrail.Value = ""
  216.                   --print(player.Name.." unequipped the ".. Snowtrail.Name.." trail")          
  217.                     wait(1)
  218.                     debounce = true
  219.                     return "Unequip"
  220.                 end                    
  221.              end
  222.           end
  223.        end
  224.     end
  225.     wait(5)
  226.     debounce = true
  227. end
  228.  
  229. game.ReplicatedStorage.Events.BuyItem2.OnServerInvoke = function(player, RedtrailName)
  230.     if debounce == true then
  231.     debounce = false
  232.     --print("RemoteFunction fired")
  233.     local ifsInInventory   
  234.     if player.TrailInventory:FindFirstChild("Red") then
  235.         ifsInInventory = true
  236.     end
  237.  
  238.     if Redtrail then
  239.         if Redtrail:FindFirstChild("Price") then
  240.             if not ifsInInventory then
  241.                 -- Check if we can buy the trail
  242.                 if player.leaderstats.Coins.Value >= Redtrail.Price.Value then
  243.                     print(player.Name.." brought the ".. Redtrail.Name.." trail")
  244.                     player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Redtrail.Price.Value
  245.                     local bool2 = Instance.new("BoolValue",player.TrailInventory); bool2.Name = Redtrail.Name
  246.                     return "Brought"
  247.                 else
  248.                     return "NotEnough"     
  249.                 end
  250.             else
  251.                 -- You already owned it
  252.                 if player.EquippedTrail.Value ~= Redtrail.Name and ifsInInventory then                             
  253.                     player.EquippedTrail.Value = Redtrail.Name
  254.                 --  print(player.Name.." equipped the ".. Bluetrail.Name.." trail")    
  255.                     wait(1)
  256.                     debounce = true
  257.                     return "Equip"                 
  258.                 else                       
  259.                     player.EquippedTrail.Value = ""
  260.                     --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  261.                     wait(1)
  262.                     debounce = true
  263.                     return "Unequip"               
  264.                     end        
  265.                 end        
  266.             end
  267.         end
  268.     end
  269.     wait(5)
  270.     debounce = true
  271. end
  272.  
  273. game.ReplicatedStorage.Events.BuyItem3.OnServerInvoke = function(player, LimetrailName)
  274.     if debounce == true then
  275.         debounce = false
  276.         --print("RemoteFunction fired")
  277.         local ifsInInventory   
  278.         if player.TrailInventory:FindFirstChild("Lime") then
  279.             ifsInInventory = true
  280.         end
  281.  
  282.         if Limetrail then
  283.             if Limetrail:FindFirstChild("Price") then
  284.                 if not ifsInInventory then
  285.                     -- Check if we can buy the trail
  286.                     if player.leaderstats.Coins.Value >= Limetrail.Price.Value then
  287.                         print(player.Name.." brought the ".. Limetrail.Name.." trail")
  288.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Limetrail.Price.Value
  289.                         local bool3 = Instance.new("BoolValue",player.TrailInventory); bool3.Name = Limetrail.Name
  290.                         return "Brought"
  291.                     else
  292.                         return "NotEnough"     
  293.                     end
  294.                 else
  295.                     -- You already owned it
  296.                     if player.EquippedTrail.Value ~= Limetrail.Name and ifsInInventory then                            
  297.                         player.EquippedTrail.Value = Limetrail.Name
  298.                       --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")    
  299.                         wait(1)
  300.                         debounce = true
  301.                         return "Equip"                 
  302.                     else                       
  303.                         player.EquippedTrail.Value = ""
  304.                       --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")  
  305.                         wait(1)
  306.                         debounce = true
  307.                         return "Unequip"               
  308.                     end        
  309.                 end        
  310.             end
  311.         end
  312.     end
  313.     wait(5)
  314.     debounce = true
  315. end
  316.  
  317. game.ReplicatedStorage.Events.BuyItem4.OnServerInvoke = function(player, BluetrailName)
  318.     if debounce == true then
  319.         debounce = false
  320.         --print("RemoteFunction fired")
  321.         local ifsInInventory   
  322.         if player.TrailInventory:FindFirstChild("Blue") then
  323.             ifsInInventory = true
  324.         end
  325.  
  326.         if Bluetrail then
  327.             if Bluetrail:FindFirstChild("Price") then
  328.                 if not ifsInInventory then
  329.                     -- Check if we can buy the trail
  330.                     if player.leaderstats.Coins.Value >= Bluetrail.Price.Value then
  331.                         print(player.Name.." brought the ".. Bluetrail.Name.." trail")
  332.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Bluetrail.Price.Value
  333.                         local bool4 = Instance.new("BoolValue",player.TrailInventory); bool4.Name = Bluetrail.Name
  334.                         return "Brought"
  335.                     else
  336.                         return "NotEnough"     
  337.                     end
  338.                 else
  339.                     -- You already owned it
  340.                     if player.EquippedTrail.Value ~= Bluetrail.Name and ifsInInventory then                            
  341.                         player.EquippedTrail.Value = Bluetrail.Name
  342.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  343.                         wait(1)
  344.                         debounce = true
  345.                         return "Equip"                 
  346.                     else                       
  347.                         player.EquippedTrail.Value = ""
  348.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  349.                         wait(1)
  350.                         debounce = true
  351.                         return "Unequip"               
  352.                     end        
  353.                 end        
  354.             end
  355.         end
  356.     end
  357.     wait(5)
  358.     debounce = true
  359. end
  360.  
  361. game.ReplicatedStorage.Events.BuyItem5.OnServerInvoke = function(player, PinktrailName)
  362.     if debounce == true then
  363.         debounce = false
  364.         --print("RemoteFunction fired")
  365.         local ifsInInventory   
  366.         if player.TrailInventory:FindFirstChild("Pink") then
  367.             ifsInInventory = true
  368.         end
  369.  
  370.         if Pinktrail then
  371.             if Pinktrail:FindFirstChild("Price") then
  372.                 if not ifsInInventory then
  373.                     -- Check if we can buy the trail
  374.                     if player.leaderstats.Coins.Value >= Pinktrail.Price.Value then
  375.                         print(player.Name.." brought the ".. Pinktrail.Name.." trail")
  376.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Pinktrail.Price.Value
  377.                         local bool5 = Instance.new("BoolValue",player.TrailInventory); bool5.Name = Pinktrail.Name
  378.                         return "Brought"
  379.                     else
  380.                         return "NotEnough"     
  381.                     end
  382.                 else
  383.                     -- You already owned it
  384.                     if player.EquippedTrail.Value ~= Pinktrail.Name and ifsInInventory then                            
  385.                         player.EquippedTrail.Value = Pinktrail.Name
  386.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  387.                         wait(1)
  388.                         debounce = true
  389.                         return "Equip"                 
  390.                     else                       
  391.                         player.EquippedTrail.Value = ""
  392.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  393.                         wait(1)
  394.                         debounce = true
  395.                         return "Unequip"               
  396.                     end        
  397.                 end        
  398.             end
  399.         end
  400.     end
  401.     wait(5)
  402.     debounce = true
  403. end
  404.  
  405. game.ReplicatedStorage.Events.BuyItem6.OnServerInvoke = function(player, OrangetrailName)
  406.     if debounce == true then
  407.         debounce = false
  408.         --print("RemoteFunction fired")
  409.         local ifsInInventory   
  410.         if player.TrailInventory:FindFirstChild("Orange") then
  411.             ifsInInventory = true
  412.         end
  413.  
  414.         if Orangetrail then
  415.             if Orangetrail:FindFirstChild("Price") then
  416.                 if not ifsInInventory then
  417.                     -- Check if we can buy the trail
  418.                     if player.leaderstats.Coins.Value >= Orangetrail.Price.Value then
  419.                         print(player.Name.." brought the ".. Orangetrail.Name.." trail")
  420.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Orangetrail.Price.Value
  421.                         local bool6 = Instance.new("BoolValue",player.TrailInventory); bool6.Name = Orangetrail.Name
  422.                         return "Brought"
  423.                     else
  424.                         return "NotEnough"     
  425.                     end
  426.                 else
  427.                     -- You already owned it
  428.                     if player.EquippedTrail.Value ~= Orangetrail.Name and ifsInInventory then                              
  429.                         player.EquippedTrail.Value = Orangetrail.Name
  430.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  431.                         wait(1)
  432.                         debounce = true
  433.                         return "Equip"                 
  434.                     else                       
  435.                         player.EquippedTrail.Value = ""
  436.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  437.                         wait(1)
  438.                         debounce = true
  439.                         return "Unequip"               
  440.                     end        
  441.                 end        
  442.             end
  443.         end
  444.     end
  445.     wait(5)
  446.     debounce = true
  447. end
  448.  
  449. game.ReplicatedStorage.Events.BuyItem7.OnServerInvoke = function(player, PurpletrailName)
  450.     if debounce == true then
  451.         debounce = false
  452.         --print("RemoteFunction fired")
  453.         local ifsInInventory   
  454.         if player.TrailInventory:FindFirstChild("Purple") then
  455.             ifsInInventory = true
  456.         end
  457.  
  458.         if Purpletrail then
  459.             if Purpletrail:FindFirstChild("Price") then
  460.                 if not ifsInInventory then
  461.                     -- Check if we can buy the trail
  462.                     if player.leaderstats.Coins.Value >= Purpletrail.Price.Value then
  463.                         print(player.Name.." brought the ".. Purpletrail.Name.." trail")
  464.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Purpletrail.Price.Value
  465.                         local bool7 = Instance.new("BoolValue",player.TrailInventory); bool7.Name = Purpletrail.Name
  466.                         return "Brought"
  467.                     else
  468.                         return "NotEnough"     
  469.                     end
  470.                 else
  471.                     -- You already owned it
  472.                     if player.EquippedTrail.Value ~= Purpletrail.Name and ifsInInventory then                              
  473.                         player.EquippedTrail.Value = Purpletrail.Name
  474.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  475.                         wait(1)
  476.                         debounce = true
  477.                         return "Equip"                 
  478.                     else                       
  479.                         player.EquippedTrail.Value = ""
  480.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  481.                         wait(1)
  482.                         debounce = true
  483.                         return "Unequip"               
  484.                     end        
  485.                 end        
  486.             end
  487.         end
  488.     end
  489.     wait(5)
  490.     debounce = true
  491. end
  492.  
  493. game.ReplicatedStorage.Events.BuyItem8.OnServerInvoke = function(player, YellowtrailName)
  494.     if debounce == true then
  495.         debounce = false
  496.         --print("RemoteFunction fired")
  497.         local ifsInInventory   
  498.         if player.TrailInventory:FindFirstChild("Yellow") then
  499.             ifsInInventory = true
  500.         end
  501.  
  502.         if Yellowtrail then
  503.             if Yellowtrail:FindFirstChild("Price") then
  504.                 if not ifsInInventory then
  505.                     -- Check if we can buy the trail
  506.                     if player.leaderstats.Coins.Value >= Yellowtrail.Price.Value then
  507.                         print(player.Name.." brought the ".. Yellowtrail.Name.." trail")
  508.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Yellowtrail.Price.Value
  509.                         local bool8 = Instance.new("BoolValue",player.TrailInventory); bool8.Name = Yellowtrail.Name
  510.                         return "Brought"
  511.                     else
  512.                         return "NotEnough"     
  513.                     end
  514.                 else
  515.                     -- You already owned it
  516.                     if player.EquippedTrail.Value ~= Yellowtrail.Name and ifsInInventory then                              
  517.                         player.EquippedTrail.Value = Yellowtrail.Name
  518.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  519.                         wait(1)
  520.                         debounce = true
  521.                         return "Equip"                 
  522.                     else                       
  523.                         player.EquippedTrail.Value = ""
  524.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  525.                         wait(1)
  526.                         debounce = true
  527.                         return "Unequip"               
  528.                     end        
  529.                 end        
  530.             end
  531.         end
  532.     end
  533.     wait(5)
  534.     debounce = true
  535. end
  536.  
  537. game.ReplicatedStorage.Events.BuyItem9.OnServerInvoke = function(player, DiamondtrailName)
  538.     if debounce == true then
  539.         debounce = false
  540.         --print("RemoteFunction fired")
  541.         local ifsInInventory   
  542.         if player.TrailInventory:FindFirstChild("Diamond") then
  543.             ifsInInventory = true
  544.         end
  545.  
  546.         if Diamondtrail then
  547.             if Diamondtrail:FindFirstChild("Price") then
  548.                 if not ifsInInventory then
  549.                     -- Check if we can buy the trail
  550.                     if player.leaderstats.Coins.Value >= Diamondtrail.Price.Value then
  551.                         print(player.Name.." brought the ".. Diamondtrail.Name.." trail")
  552.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Diamondtrail.Price.Value
  553.                         local bool9 = Instance.new("BoolValue",player.TrailInventory); bool9.Name = Diamondtrail.Name
  554.                         return "Brought"
  555.                     else
  556.                         return "NotEnough"     
  557.                     end
  558.                 else
  559.                     -- You already owned it
  560.                     if player.EquippedTrail.Value ~= Diamondtrail.Name and ifsInInventory then                             
  561.                         player.EquippedTrail.Value = Diamondtrail.Name
  562.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  563.                         wait(1)
  564.                         debounce = true
  565.                         return "Equip"                 
  566.                     else                       
  567.                         player.EquippedTrail.Value = ""
  568.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  569.                         wait(1)
  570.                         debounce = true
  571.                         return "Unequip"               
  572.                     end        
  573.                 end        
  574.             end
  575.         end
  576.     end
  577.     wait(5)
  578.     debounce = true
  579. end
  580.  
  581. game.ReplicatedStorage.Events.BuyItem10.OnServerInvoke = function(player, DarktrailName)
  582.     if debounce == true then
  583.         debounce = false
  584.         --print("RemoteFunction fired")
  585.         local ifsInInventory   
  586.         if player.TrailInventory:FindFirstChild("Dark") then
  587.             ifsInInventory = true
  588.         end
  589.  
  590.         if Darktrail then
  591.             if Darktrail:FindFirstChild("Price") then
  592.                 if not ifsInInventory then
  593.                     -- Check if we can buy the trail
  594.                     if player.leaderstats.Coins.Value >= Darktrail.Price.Value then
  595.                         print(player.Name.." brought the ".. Darktrail.Name.." trail")
  596.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Darktrail.Price.Value
  597.                         local bool10 = Instance.new("BoolValue",player.TrailInventory); bool10.Name = Darktrail.Name
  598.                         return "Brought"
  599.                     else
  600.                         return "NotEnough"     
  601.                     end
  602.                 else
  603.                     -- You already owned it
  604.                     if player.EquippedTrail.Value ~= Darktrail.Name and ifsInInventory then                            
  605.                         player.EquippedTrail.Value = Darktrail.Name
  606.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  607.                         wait(1)
  608.                         debounce = true
  609.                         return "Equip"                 
  610.                     else                       
  611.                         player.EquippedTrail.Value = ""
  612.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  613.                         wait(1)
  614.                         debounce = true
  615.                         return "Unequip"               
  616.                     end        
  617.                 end        
  618.             end
  619.         end
  620.     end
  621.     wait(5)
  622.     debounce = true
  623. end
  624.  
  625. game.ReplicatedStorage.Events.BuyItem11.OnServerInvoke = function(player, RainbowtrailName)
  626.     if debounce == true then
  627.         debounce = false
  628.         --print("RemoteFunction fired")
  629.         local ifsInInventory   
  630.         if player.TrailInventory:FindFirstChild("Rainbow") then
  631.             ifsInInventory = true
  632.         end
  633.  
  634.         if Rainbowtrail then
  635.             if Rainbowtrail:FindFirstChild("Price") then
  636.                 if not ifsInInventory then
  637.                     -- Check if we can buy the trail
  638.                     if player.leaderstats.Coins.Value >= Rainbowtrail.Price.Value then
  639.                         print(player.Name.." brought the ".. Rainbowtrail.Name.." trail")
  640.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Rainbowtrail.Price.Value
  641.                         local bool11 = Instance.new("BoolValue",player.TrailInventory); bool11.Name = Rainbowtrail.Name
  642.                         return "Brought"
  643.                     else
  644.                         return "NotEnough"     
  645.                     end
  646.                 else
  647.                     -- You already owned it
  648.                     if player.EquippedTrail.Value ~= Rainbowtrail.Name and ifsInInventory then                             
  649.                         player.EquippedTrail.Value = Rainbowtrail.Name
  650.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  651.                         wait(1)
  652.                         debounce = true
  653.                         return "Equip"                 
  654.                     else                       
  655.                         player.EquippedTrail.Value = ""
  656.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  657.                         wait(1)
  658.                         debounce = true
  659.                         return "Unequip"               
  660.                     end        
  661.                 end        
  662.             end
  663.         end
  664.     end
  665.     wait(5)
  666.     debounce = true
  667. end
  668.  
  669. game.ReplicatedStorage.Events.BuyItem12.OnServerInvoke = function(player, HelltrailName)
  670.     if debounce == true then
  671.         debounce = false
  672.         --print("RemoteFunction fired")
  673.         local ifsInInventory   
  674.         if player.TrailInventory:FindFirstChild("Hell") then
  675.             ifsInInventory = true
  676.         end
  677.  
  678.         if Helltrail then
  679.             if Helltrail:FindFirstChild("Price") then
  680.                 if not ifsInInventory then
  681.                     -- Check if we can buy the trail
  682.                     if player.leaderstats.Coins.Value >= Helltrail.Price.Value then
  683.                         print(player.Name.." brought the ".. Helltrail.Name.." trail")
  684.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Helltrail.Price.Value
  685.                         local bool12 = Instance.new("BoolValue",player.TrailInventory); bool12.Name = Helltrail.Name
  686.                         return "Brought"
  687.                     else
  688.                         return "NotEnough"     
  689.                     end
  690.                 else
  691.                     -- You already owned it
  692.                     if player.EquippedTrail.Value ~= Helltrail.Name and ifsInInventory then                            
  693.                         player.EquippedTrail.Value = Helltrail.Name
  694.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  695.                         wait(1)
  696.                         debounce = true
  697.                         return "Equip"                 
  698.                     else                       
  699.                         player.EquippedTrail.Value = ""
  700.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  701.                         wait(1)
  702.                         debounce = true
  703.                         return "Unequip"               
  704.                     end        
  705.                 end        
  706.             end
  707.         end
  708.     end
  709.     wait(5)
  710.     debounce = true
  711. end
  712.  
  713. game.ReplicatedStorage.Events.BuyItem13.OnServerInvoke = function(player, DemontrailName)
  714.     if debounce == true then
  715.         debounce = false
  716.         --print("RemoteFunction fired")
  717.         local ifsInInventory   
  718.         if player.TrailInventory:FindFirstChild("Demon") then
  719.             ifsInInventory = true
  720.         end
  721.  
  722.         if Demontrail then
  723.             if Demontrail:FindFirstChild("Price") then
  724.                 if not ifsInInventory then
  725.                     -- Check if we can buy the trail
  726.                     if player.leaderstats.Coins.Value >= Demontrail.Price.Value then
  727.                         print(player.Name.." brought the ".. Demontrail.Name.." trail")
  728.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Demontrail.Price.Value
  729.                         local bool13 = Instance.new("BoolValue",player.TrailInventory); bool13.Name = Demontrail.Name
  730.                         return "Brought"
  731.                     else
  732.                         return "NotEnough"     
  733.                     end
  734.                 else
  735.                     -- You already owned it
  736.                     if player.EquippedTrail.Value ~= Demontrail.Name and ifsInInventory then                               
  737.                         player.EquippedTrail.Value = Demontrail.Name
  738.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  739.                         wait(1)
  740.                         debounce = true
  741.                         return "Equip"                 
  742.                     else                       
  743.                         player.EquippedTrail.Value = ""
  744.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  745.                         wait(1)
  746.                         debounce = true
  747.                         return "Unequip"               
  748.                     end        
  749.                 end        
  750.             end
  751.         end
  752.     end
  753.     wait(5)
  754.     debounce = true
  755. end
  756.  
  757. game.ReplicatedStorage.Events.BuyItem14.OnServerInvoke = function(player, CrimsontrailName)
  758.     if debounce == true then
  759.         debounce = false
  760.         --print("RemoteFunction fired")
  761.         local ifsInInventory   
  762.         if player.TrailInventory:FindFirstChild("Crimson") then
  763.             ifsInInventory = true
  764.         end
  765.  
  766.         if Crimsontrail then
  767.             if Crimsontrail:FindFirstChild("Price") then
  768.                 if not ifsInInventory then
  769.                     -- Check if we can buy the trail
  770.                     if player.leaderstats.Coins.Value >= Crimsontrail.Price.Value then
  771.                         print(player.Name.." brought the ".. Crimsontrail.Name.." trail")
  772.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Crimsontrail.Price.Value
  773.                         local bool14 = Instance.new("BoolValue",player.TrailInventory); bool14.Name = Crimsontrail.Name
  774.                         return "Brought"
  775.                     else
  776.                         return "NotEnough"     
  777.                     end
  778.                 else
  779.                     -- You already owned it
  780.                     if player.EquippedTrail.Value ~= Crimsontrail.Name and ifsInInventory then                             
  781.                         player.EquippedTrail.Value = Crimsontrail.Name
  782.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  783.                         wait(1)
  784.                         debounce = true
  785.                         return "Equip"                 
  786.                     else                       
  787.                         player.EquippedTrail.Value = ""
  788.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  789.                         wait(1)
  790.                         debounce = true
  791.                         return "Unequip"               
  792.                     end        
  793.                 end        
  794.             end
  795.         end
  796.     end
  797.     wait(5)
  798.     debounce = true
  799. end
  800.  
  801. game.ReplicatedStorage.Events.BuyItem15.OnServerInvoke = function(player, WavestrailName)
  802.     if debounce == true then
  803.         debounce = false
  804.         --print("RemoteFunction fired")
  805.         local ifsInInventory   
  806.         if player.TrailInventory:FindFirstChild("Waves") then
  807.             ifsInInventory = true
  808.         end
  809.  
  810.         if Wavestrail then
  811.             if Wavestrail:FindFirstChild("Price") then
  812.                 if not ifsInInventory then
  813.                     -- Check if we can buy the trail
  814.                     if player.leaderstats.Coins.Value >= Wavestrail.Price.Value then
  815.                         print(player.Name.." brought the ".. Wavestrail.Name.." trail")
  816.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Wavestrail.Price.Value
  817.                         local bool15 = Instance.new("BoolValue",player.TrailInventory); bool15.Name = Wavestrail.Name
  818.                         return "Brought"
  819.                     else
  820.                         return "NotEnough"     
  821.                     end
  822.                 else
  823.                     -- You already owned it
  824.                     if player.EquippedTrail.Value ~= Wavestrail.Name and ifsInInventory then                               
  825.                         player.EquippedTrail.Value = Wavestrail.Name
  826.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  827.                         wait(1)
  828.                         debounce = true
  829.                         return "Equip"                 
  830.                     else                       
  831.                         player.EquippedTrail.Value = ""
  832.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  833.                         wait(1)
  834.                         debounce = true
  835.                         return "Unequip"               
  836.                     end        
  837.                 end        
  838.             end
  839.         end
  840.     end
  841.     wait(5)
  842.     debounce = true
  843. end
  844.  
  845. game.ReplicatedStorage.Events.BuyItem16.OnServerInvoke = function(player, ReapertrailName)
  846.     if debounce == true then
  847.         debounce = false
  848.         --print("RemoteFunction fired")
  849.         local ifsInInventory   
  850.         if player.TrailInventory:FindFirstChild("Reaper") then
  851.             ifsInInventory = true
  852.         end
  853.  
  854.         if Reapertrail then
  855.             if Reapertrail:FindFirstChild("Price") then
  856.                 if not ifsInInventory then
  857.                     -- Check if we can buy the trail
  858.                     if player.leaderstats.Coins.Value >= Reapertrail.Price.Value then
  859.                         print(player.Name.." brought the ".. Reapertrail.Name.." trail")
  860.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Reapertrail.Price.Value
  861.                         local bool16 = Instance.new("BoolValue",player.TrailInventory); bool16.Name = Reapertrail.Name
  862.                         return "Brought"
  863.                     else
  864.                         return "NotEnough"     
  865.                     end
  866.                 else
  867.                     -- You already owned it
  868.                     if player.EquippedTrail.Value ~= Reapertrail.Name and ifsInInventory then                              
  869.                         player.EquippedTrail.Value = Reapertrail.Name
  870.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  871.                         wait(1)
  872.                         debounce = true
  873.                         return "Equip"                 
  874.                     else                       
  875.                         player.EquippedTrail.Value = ""
  876.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  877.                         wait(1)
  878.                         debounce = true
  879.                         return "Unequip"               
  880.                     end        
  881.                 end        
  882.             end
  883.         end
  884.     end
  885.     wait(5)
  886.     debounce = true
  887. end
  888.  
  889. game.ReplicatedStorage.Events.BuyItem17.OnServerInvoke = function(player, GhoultrailName)
  890.     if debounce == true then
  891.         debounce = false
  892.         --print("RemoteFunction fired")
  893.         local ifsInInventory   
  894.         if player.TrailInventory:FindFirstChild("Ghoul") then
  895.             ifsInInventory = true
  896.         end
  897.  
  898.         if Ghoultrail then
  899.             if Ghoultrail:FindFirstChild("Price") then
  900.                 if not ifsInInventory then
  901.                     -- Check if we can buy the trail
  902.                     if player.leaderstats.Coins.Value >= Ghoultrail.Price.Value then
  903.                         print(player.Name.." brought the ".. Ghoultrail.Name.." trail")
  904.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Ghoultrail.Price.Value
  905.                         local bool17 = Instance.new("BoolValue",player.TrailInventory); bool17.Name = Ghoultrail.Name
  906.                         return "Brought"
  907.                     else
  908.                         return "NotEnough"     
  909.                     end
  910.                 else
  911.                     -- You already owned it
  912.                     if player.EquippedTrail.Value ~= Ghoultrail.Name and ifsInInventory then                               
  913.                         player.EquippedTrail.Value = Ghoultrail.Name
  914.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  915.                         wait(1)
  916.                         debounce = true
  917.                         return "Equip"                 
  918.                     else                       
  919.                         player.EquippedTrail.Value = ""
  920.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  921.                         wait(1)
  922.                         debounce = true
  923.                         return "Unequip"               
  924.                     end        
  925.                 end        
  926.             end
  927.         end
  928.     end
  929.     wait(5)
  930.     debounce = true
  931. end
  932.  
  933. game.ReplicatedStorage.Events.BuyItem18.OnServerInvoke = function(player, DragontrailName)
  934.     if debounce == true then
  935.         debounce = false
  936.         --print("RemoteFunction fired")
  937.         local ifsInInventory   
  938.         if player.TrailInventory:FindFirstChild("Dragon") then
  939.             ifsInInventory = true
  940.         end
  941.  
  942.         if Dragontrail then
  943.             if Dragontrail:FindFirstChild("Price") then
  944.                 if not ifsInInventory then
  945.                     -- Check if we can buy the trail
  946.                     if player.leaderstats.Coins.Value >= Dragontrail.Price.Value then
  947.                         print(player.Name.." brought the ".. Dragontrail.Name.." trail")
  948.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Dragontrail.Price.Value
  949.                         local bool18 = Instance.new("BoolValue",player.TrailInventory); bool18.Name = Dragontrail.Name
  950.                         return "Brought"
  951.                     else
  952.                         return "NotEnough"     
  953.                     end
  954.                 else
  955.                     -- You already owned it
  956.                     if player.EquippedTrail.Value ~= Dragontrail.Name and ifsInInventory then                              
  957.                         player.EquippedTrail.Value = Dragontrail.Name
  958.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  959.                         wait(1)
  960.                         debounce = true
  961.                         return "Equip"                 
  962.                     else                       
  963.                         player.EquippedTrail.Value = ""
  964.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  965.                         wait(1)
  966.                         debounce = true
  967.                         return "Unequip"               
  968.                     end        
  969.                 end        
  970.             end
  971.         end
  972.     end
  973.     wait(5)
  974.     debounce = true
  975. end
  976.  
  977. game.ReplicatedStorage.Events.BuyItem19.OnServerInvoke = function(player, VoidtrailName)
  978.     if debounce == true then
  979.         debounce = false
  980.         --print("RemoteFunction fired")
  981.         local ifsInInventory   
  982.         if player.TrailInventory:FindFirstChild("Void") then
  983.             ifsInInventory = true
  984.         end
  985.  
  986.         if Voidtrail then
  987.             if Voidtrail:FindFirstChild("Price") then
  988.                 if not ifsInInventory then
  989.                     -- Check if we can buy the trail
  990.                     if player.leaderstats.Coins.Value >= Voidtrail.Price.Value then
  991.                         print(player.Name.." brought the ".. Voidtrail.Name.." trail")
  992.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Voidtrail.Price.Value
  993.                         local bool19 = Instance.new("BoolValue",player.TrailInventory); bool19.Name = Voidtrail.Name
  994.                         return "Brought"
  995.                     else
  996.                         return "NotEnough"     
  997.                     end
  998.                 else
  999.                     -- You already owned it
  1000.                     if player.EquippedTrail.Value ~= Voidtrail.Name and ifsInInventory then                            
  1001.                         player.EquippedTrail.Value = Voidtrail.Name
  1002.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  1003.                         wait(1)
  1004.                         debounce = true
  1005.                         return "Equip"                 
  1006.                     else                       
  1007.                         player.EquippedTrail.Value = ""
  1008.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  1009.                         wait(1)
  1010.                         debounce = true
  1011.                         return "Unequip"               
  1012.                     end        
  1013.                 end        
  1014.             end
  1015.         end
  1016.     end
  1017.     wait(5)
  1018.     debounce = true
  1019. end
  1020.  
  1021. game.ReplicatedStorage.Events.BuyItem20.OnServerInvoke = function(player, FoxtrailName)
  1022.     if debounce == true then
  1023.         debounce = false
  1024.         --print("RemoteFunction fired")
  1025.         local ifsInInventory   
  1026.         if player.TrailInventory:FindFirstChild("Fox") then
  1027.             ifsInInventory = true
  1028.         end
  1029.  
  1030.         if Foxtrail then
  1031.             if Foxtrail:FindFirstChild("Price") then
  1032.                 if not ifsInInventory then
  1033.                     -- Check if we can buy the trail
  1034.                     if player.leaderstats.Coins.Value >= Foxtrail.Price.Value then
  1035.                         print(player.Name.." brought the ".. Foxtrail.Name.." trail")
  1036.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Foxtrail.Price.Value
  1037.                         local bool20 = Instance.new("BoolValue",player.TrailInventory); bool20.Name = Foxtrail.Name
  1038.                         return "Brought"
  1039.                     else
  1040.                         return "NotEnough"     
  1041.                     end
  1042.                 else
  1043.                     -- You already owned it
  1044.                     if player.EquippedTrail.Value ~= Foxtrail.Name and ifsInInventory then                             
  1045.                         player.EquippedTrail.Value = Foxtrail.Name
  1046.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  1047.                         wait(1)
  1048.                         debounce = true
  1049.                         return "Equip"                 
  1050.                     else                       
  1051.                         player.EquippedTrail.Value = ""
  1052.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  1053.                         wait(1)
  1054.                         debounce = true
  1055.                         return "Unequip"               
  1056.                     end        
  1057.                 end        
  1058.             end
  1059.         end
  1060.     end
  1061.     wait(5)
  1062.     debounce = true
  1063. end
  1064.  
  1065. game.ReplicatedStorage.Events.BuyItem21.OnServerInvoke = function(player, KyuubitrailName)
  1066.     if debounce == true then
  1067.         debounce = false
  1068.         --print("RemoteFunction fired")
  1069.         local ifsInInventory   
  1070.         if player.TrailInventory:FindFirstChild("Kyuubi") then
  1071.             ifsInInventory = true
  1072.         end
  1073.  
  1074.         if Kyuubitrail then
  1075.             if Kyuubitrail:FindFirstChild("Price") then
  1076.                 if not ifsInInventory then
  1077.                     -- Check if we can buy the trail
  1078.                     if player.leaderstats.Coins.Value >= Kyuubitrail.Price.Value then
  1079.                         print(player.Name.." brought the ".. Kyuubitrail.Name.." trail")
  1080.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Kyuubitrail.Price.Value
  1081.                         local bool21 = Instance.new("BoolValue",player.TrailInventory); bool21.Name = Kyuubitrail.Name
  1082.                         return "Brought"
  1083.                     else
  1084.                         return "NotEnough"     
  1085.                     end
  1086.                 else
  1087.                     -- You already owned it
  1088.                     if player.EquippedTrail.Value ~= Kyuubitrail.Name and ifsInInventory then                              
  1089.                         player.EquippedTrail.Value = Kyuubitrail.Name
  1090.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  1091.                         wait(1)
  1092.                         debounce = true
  1093.                         return "Equip"                 
  1094.                     else                       
  1095.                         player.EquippedTrail.Value = ""
  1096.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  1097.                         wait(1)
  1098.                         debounce = true
  1099.                         return "Unequip"               
  1100.                     end        
  1101.                 end        
  1102.             end
  1103.         end
  1104.     end
  1105.     wait(5)
  1106.     debounce = true
  1107. end
  1108.  
  1109. game.ReplicatedStorage.Events.BuyItem22.OnServerInvoke = function(player, NineTailstrailName)
  1110.     if debounce == true then
  1111.         debounce = false
  1112.         --print("RemoteFunction fired")
  1113.         local ifsInInventory   
  1114.         if player.TrailInventory:FindFirstChild("NineTails") then
  1115.             ifsInInventory = true
  1116.         end
  1117.  
  1118.         if NineTailstrail then
  1119.             if NineTailstrail:FindFirstChild("Price") then
  1120.                 if not ifsInInventory then
  1121.                     -- Check if we can buy the trail
  1122.                     if player.leaderstats.Coins.Value >= NineTailstrail.Price.Value then
  1123.                         print(player.Name.." brought the ".. NineTailstrail.Name.." trail")
  1124.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - NineTailstrail.Price.Value
  1125.                         local bool22 = Instance.new("BoolValue",player.TrailInventory); bool22.Name = NineTailstrail.Name
  1126.                         return "Brought"
  1127.                     else
  1128.                         return "NotEnough"     
  1129.                     end
  1130.                 else
  1131.                     -- You already owned it
  1132.                     if player.EquippedTrail.Value ~= NineTailstrail.Name and ifsInInventory then                               
  1133.                         player.EquippedTrail.Value = NineTailstrail.Name
  1134.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  1135.                         wait(1)
  1136.                         debounce = true
  1137.                         return "Equip"                 
  1138.                     else                       
  1139.                         player.EquippedTrail.Value = ""
  1140.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  1141.                         wait(1)
  1142.                         debounce = true
  1143.                         return "Unequip"               
  1144.                     end        
  1145.                 end        
  1146.             end
  1147.         end
  1148.     end
  1149.     wait(5)
  1150.     debounce = true
  1151. end
  1152.  
  1153. game.ReplicatedStorage.Events.BuyItem23.OnServerInvoke = function(player, JuubitrailName)
  1154.     if debounce == true then
  1155.         debounce = false
  1156.         --print("RemoteFunction fired")
  1157.         local ifsInInventory   
  1158.         if player.TrailInventory:FindFirstChild("Juubi") then
  1159.             ifsInInventory = true
  1160.         end
  1161.  
  1162.         if Juubitrail then
  1163.             if Juubitrail:FindFirstChild("Price") then
  1164.                 if not ifsInInventory then
  1165.                     -- Check if we can buy the trail
  1166.                     if player.leaderstats.Coins.Value >= Juubitrail.Price.Value then
  1167.                         print(player.Name.." brought the ".. Juubitrail.Name.." trail")
  1168.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Juubitrail.Price.Value
  1169.                         local bool23 = Instance.new("BoolValue",player.TrailInventory); bool23.Name = Juubitrail.Name
  1170.                         return "Brought"
  1171.                     else
  1172.                         return "NotEnough"     
  1173.                     end
  1174.                 else
  1175.                     -- You already owned it
  1176.                     if player.EquippedTrail.Value ~= Juubitrail.Name and ifsInInventory then                               
  1177.                         player.EquippedTrail.Value = Juubitrail.Name
  1178.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  1179.                         wait(1)
  1180.                         debounce = true
  1181.                         return "Equip"                 
  1182.                     else                       
  1183.                         player.EquippedTrail.Value = ""
  1184.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  1185.                         wait(1)
  1186.                         debounce = true
  1187.                         return "Unequip"               
  1188.                     end        
  1189.                 end        
  1190.             end
  1191.         end
  1192.     end
  1193.     wait(5)
  1194.     debounce = true
  1195. end
  1196.  
  1197. game.ReplicatedStorage.Events.BuyItem24.OnServerInvoke = function(player, MadaraJuubitrailName)
  1198.     if debounce == true then
  1199.         debounce = false
  1200.         --print("RemoteFunction fired")
  1201.         local ifsInInventory   
  1202.         if player.TrailInventory:FindFirstChild("Madara&Juubi") then
  1203.             ifsInInventory = true
  1204.         end
  1205.  
  1206.         if MadaraJuubitrail then
  1207.             if MadaraJuubitrail:FindFirstChild("Price") then
  1208.                 if not ifsInInventory then
  1209.                     -- Check if we can buy the trail
  1210.                     if player.leaderstats.Coins.Value >= MadaraJuubitrail.Price.Value then
  1211.                         print(player.Name.." brought the ".. MadaraJuubitrail.Name.." trail")
  1212.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - MadaraJuubitrail.Price.Value
  1213.                         local bool24 = Instance.new("BoolValue",player.TrailInventory); bool24.Name = MadaraJuubitrail.Name
  1214.                         return "Brought"
  1215.                     else
  1216.                         return "NotEnough"     
  1217.                     end
  1218.                 else
  1219.                     -- You already owned it
  1220.                     if player.EquippedTrail.Value ~= MadaraJuubitrail.Name and ifsInInventory then                             
  1221.                         player.EquippedTrail.Value = MadaraJuubitrail.Name
  1222.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  1223.                         wait(1)
  1224.                         debounce = true
  1225.                         return "Equip"                 
  1226.                     else                       
  1227.                         player.EquippedTrail.Value = ""
  1228.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  1229.                         wait(1)
  1230.                         debounce = true
  1231.                         return "Unequip"               
  1232.                     end        
  1233.                 end        
  1234.             end
  1235.         end
  1236.     end
  1237.     wait(5)
  1238.     debounce = true
  1239. end
  1240.  
  1241. game.ReplicatedStorage.Events.BuyItem25.OnServerInvoke = function(player, ObitoMadaratrailName)
  1242.     if debounce == true then
  1243.         debounce = false
  1244.         --print("RemoteFunction fired")
  1245.         local ifsInInventory   
  1246.         if player.TrailInventory:FindFirstChild("Obito&Madara") then
  1247.             ifsInInventory = true
  1248.         end
  1249.  
  1250.         if ObitoMadaratrail then
  1251.             if ObitoMadaratrail:FindFirstChild("Price") then
  1252.                 if not ifsInInventory then
  1253.                     -- Check if we can buy the trail
  1254.                     if player.leaderstats.Coins.Value >= ObitoMadaratrail.Price.Value then
  1255.                         print(player.Name.." brought the ".. ObitoMadaratrail.Name.." trail")
  1256.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - ObitoMadaratrail.Price.Value
  1257.                         local bool25 = Instance.new("BoolValue",player.TrailInventory); bool25.Name = ObitoMadaratrail.Name
  1258.                         return "Brought"
  1259.                     else
  1260.                         return "NotEnough"     
  1261.                     end
  1262.                 else
  1263.                     -- You already owned it
  1264.                     if player.EquippedTrail.Value ~= ObitoMadaratrail.Name and ifsInInventory then                             
  1265.                         player.EquippedTrail.Value = ObitoMadaratrail.Name
  1266.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  1267.                         wait(1)
  1268.                         debounce = true
  1269.                         return "Equip"                 
  1270.                     else                       
  1271.                         player.EquippedTrail.Value = ""
  1272.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  1273.                         wait(1)
  1274.                         debounce = true
  1275.                         return "Unequip"               
  1276.                     end        
  1277.                 end        
  1278.             end
  1279.         end
  1280.     end
  1281.     wait(5)
  1282.     debounce = true
  1283. end
  1284.  
  1285. game.ReplicatedStorage.Events.BuyItem26.OnServerInvoke = function(player, AizentrailName)
  1286.     if debounce == true then
  1287.         debounce = false
  1288.         --print("RemoteFunction fired")
  1289.         local ifsInInventory   
  1290.         if player.TrailInventory:FindFirstChild("Aizen") then
  1291.             ifsInInventory = true
  1292.         end
  1293.  
  1294.         if Aizentrail then
  1295.             if Aizentrail:FindFirstChild("Price") then
  1296.                 if not ifsInInventory then
  1297.                     -- Check if we can buy the trail
  1298.                     if player.leaderstats.Coins.Value >= Aizentrail.Price.Value then
  1299.                         print(player.Name.." brought the ".. Aizentrail.Name.." trail")
  1300.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Aizentrail.Price.Value
  1301.                         local bool26 = Instance.new("BoolValue",player.TrailInventory); bool26.Name = Aizentrail.Name
  1302.                         return "Brought"
  1303.                     else
  1304.                         return "NotEnough"     
  1305.                     end
  1306.                 else
  1307.                     -- You already owned it
  1308.                     if player.EquippedTrail.Value ~= Aizentrail.Name and ifsInInventory then                               
  1309.                         player.EquippedTrail.Value = Aizentrail.Name
  1310.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  1311.                         wait(1)
  1312.                         debounce = true
  1313.                         return "Equip"                 
  1314.                     else                       
  1315.                         player.EquippedTrail.Value = ""
  1316.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  1317.                         wait(1)
  1318.                         debounce = true
  1319.                         return "Unequip"               
  1320.                     end        
  1321.                 end        
  1322.             end
  1323.         end
  1324.     end
  1325.     wait(5)
  1326.     debounce = true
  1327. end
  1328.  
  1329. game.ReplicatedStorage.Events.BuyItem27.OnServerInvoke = function(player, VastoLordtrailName)
  1330.     if debounce == true then
  1331.         debounce = false
  1332.         --print("RemoteFunction fired")
  1333.         local ifsInInventory   
  1334.         if player.TrailInventory:FindFirstChild("VastoLord") then
  1335.             ifsInInventory = true
  1336.         end
  1337.  
  1338.         if VastoLordtrail then
  1339.             if VastoLordtrail:FindFirstChild("Price") then
  1340.                 if not ifsInInventory then
  1341.                     -- Check if we can buy the trail
  1342.                     if player.leaderstats.Coins.Value >= VastoLordtrail.Price.Value then
  1343.                         print(player.Name.." brought the ".. VastoLordtrail.Name.." trail")
  1344.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - VastoLordtrail.Price.Value
  1345.                         local bool27 = Instance.new("BoolValue",player.TrailInventory); bool27.Name = VastoLordtrail.Name
  1346.                         return "Brought"
  1347.                     else
  1348.                         return "NotEnough"     
  1349.                     end
  1350.                 else
  1351.                     -- You already owned it
  1352.                     if player.EquippedTrail.Value ~= VastoLordtrail.Name and ifsInInventory then                               
  1353.                         player.EquippedTrail.Value = VastoLordtrail.Name
  1354.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  1355.                         wait(1)
  1356.                         debounce = true
  1357.                         return "Equip"                 
  1358.                     else                       
  1359.                         player.EquippedTrail.Value = ""
  1360.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  1361.                         wait(1)
  1362.                         debounce = true
  1363.                         return "Unequip"               
  1364.                     end        
  1365.                 end        
  1366.             end
  1367.         end
  1368.     end
  1369.     wait(5)
  1370.     debounce = true
  1371. end
  1372.  
  1373. game.ReplicatedStorage.Events.BuyItem28.OnServerInvoke = function(player, GokutrailName)
  1374.     if debounce == true then
  1375.         debounce = false
  1376.         --print("RemoteFunction fired")
  1377.         local ifsInInventory   
  1378.         if player.TrailInventory:FindFirstChild("Goku") then
  1379.             ifsInInventory = true
  1380.         end
  1381.  
  1382.         if Gokutrail then
  1383.             if Gokutrail:FindFirstChild("Price") then
  1384.                 if not ifsInInventory then
  1385.                     -- Check if we can buy the trail
  1386.                     if player.leaderstats.Coins.Value >= Gokutrail.Price.Value then
  1387.                         print(player.Name.." brought the ".. Gokutrail.Name.." trail")
  1388.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Gokutrail.Price.Value
  1389.                         local bool28 = Instance.new("BoolValue",player.TrailInventory); bool28.Name = Gokutrail.Name
  1390.                         return "Brought"
  1391.                     else
  1392.                         return "NotEnough"     
  1393.                     end
  1394.                 else
  1395.                     -- You already owned it
  1396.                     if player.EquippedTrail.Value ~= Gokutrail.Name and ifsInInventory then                            
  1397.                         player.EquippedTrail.Value = Gokutrail.Name
  1398.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  1399.                         wait(1)
  1400.                         debounce = true
  1401.                         return "Equip"                 
  1402.                     else                       
  1403.                         player.EquippedTrail.Value = ""
  1404.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  1405.                         wait(1)
  1406.                         debounce = true
  1407.                         return "Unequip"               
  1408.                     end        
  1409.                 end        
  1410.             end
  1411.         end
  1412.     end
  1413.     wait(5)
  1414.     debounce = true
  1415. end
  1416.  
  1417. game.ReplicatedStorage.Events.BuyItem29.OnServerInvoke = function(player, OnePunchtrailName)
  1418.     if debounce == true then
  1419.         debounce = false
  1420.         --print("RemoteFunction fired")
  1421.         local ifsInInventory   
  1422.         if player.TrailInventory:FindFirstChild("OnePunch") then
  1423.             ifsInInventory = true
  1424.         end
  1425.  
  1426.         if OnePunchtrail then
  1427.             if OnePunchtrail:FindFirstChild("Price") then
  1428.                 if not ifsInInventory then
  1429.                     -- Check if we can buy the trail
  1430.                     if player.leaderstats.Coins.Value >= OnePunchtrail.Price.Value then
  1431.                         print(player.Name.." brought the ".. OnePunchtrail.Name.." trail")
  1432.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - OnePunchtrail.Price.Value
  1433.                         local bool29 = Instance.new("BoolValue",player.TrailInventory); bool29.Name = OnePunchtrail.Name
  1434.                         return "Brought"
  1435.                     else
  1436.                         return "NotEnough"     
  1437.                     end
  1438.                 else
  1439.                     -- You already owned it
  1440.                     if player.EquippedTrail.Value ~= OnePunchtrail.Name and ifsInInventory then                            
  1441.                         player.EquippedTrail.Value = OnePunchtrail.Name
  1442.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  1443.                         wait(1)
  1444.                         debounce = true
  1445.                         return "Equip"                 
  1446.                     else                       
  1447.                         player.EquippedTrail.Value = ""
  1448.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  1449.                         wait(1)
  1450.                         debounce = true
  1451.                         return "Unequip"               
  1452.                     end        
  1453.                 end        
  1454.             end
  1455.         end
  1456.     end
  1457.     wait(5)
  1458.     debounce = true
  1459. end
  1460.  
  1461. game.ReplicatedStorage.Events.BuyItem30.OnServerInvoke = function(player, KratostrailName)
  1462.     if debounce == true then
  1463.         debounce = false
  1464.         --print("RemoteFunction fired")
  1465.         local ifsInInventory   
  1466.         if player.TrailInventory:FindFirstChild("Kratos") then
  1467.             ifsInInventory = true
  1468.         end
  1469.  
  1470.         if Kratostrail then
  1471.             if Kratostrail:FindFirstChild("Price") then
  1472.                 if not ifsInInventory then
  1473.                     -- Check if we can buy the trail
  1474.                     if player.leaderstats.Coins.Value >= Kratostrail.Price.Value then
  1475.                         print(player.Name.." brought the ".. Kratostrail.Name.." trail")
  1476.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Kratostrail.Price.Value
  1477.                         local bool30 = Instance.new("BoolValue",player.TrailInventory); bool30.Name = Kratostrail.Name
  1478.                         return "Brought"
  1479.                     else
  1480.                         return "NotEnough"     
  1481.                     end
  1482.                 else
  1483.                     -- You already owned it
  1484.                     if player.EquippedTrail.Value ~= Kratostrail.Name and ifsInInventory then                              
  1485.                         player.EquippedTrail.Value = Kratostrail.Name
  1486.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  1487.                         wait(1)
  1488.                         debounce = true
  1489.                         return "Equip"                 
  1490.                     else                       
  1491.                         player.EquippedTrail.Value = ""
  1492.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  1493.                         wait(1)
  1494.                         debounce = true
  1495.                         return "Unequip"               
  1496.                     end        
  1497.                 end        
  1498.             end
  1499.         end
  1500.     end
  1501.     wait(5)
  1502.     debounce = true
  1503. end
  1504.  
  1505. game.ReplicatedStorage.Events.BuyItem31.OnServerInvoke = function(player, DoomSlayertrailName)
  1506.     if debounce == true then
  1507.         debounce = false
  1508.         --print("RemoteFunction fired")
  1509.         local ifsInInventory   
  1510.         if player.TrailInventory:FindFirstChild("DoomSlayer") then
  1511.             ifsInInventory = true
  1512.         end
  1513.  
  1514.         if DoomSlayertrail then
  1515.             if DoomSlayertrail:FindFirstChild("Price") then
  1516.                 if not ifsInInventory then
  1517.                     -- Check if we can buy the trail
  1518.                     if player.leaderstats.Coins.Value >= DoomSlayertrail.Price.Value then
  1519.                         print(player.Name.." brought the ".. DoomSlayertrail.Name.." trail")
  1520.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - DoomSlayertrail.Price.Value
  1521.                         local bool31 = Instance.new("BoolValue",player.TrailInventory); bool31.Name = DoomSlayertrail.Name
  1522.                         return "Brought"
  1523.                     else
  1524.                         return "NotEnough"     
  1525.                     end
  1526.                 else
  1527.                     -- You already owned it
  1528.                     if player.EquippedTrail.Value ~= DoomSlayertrail.Name and ifsInInventory then                              
  1529.                         player.EquippedTrail.Value = DoomSlayertrail.Name
  1530.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  1531.                         wait(1)
  1532.                         debounce = true
  1533.                         return "Equip"                 
  1534.                     else                       
  1535.                         player.EquippedTrail.Value = ""
  1536.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  1537.                         wait(1)
  1538.                         debounce = true
  1539.                         return "Unequip"               
  1540.                     end        
  1541.                 end        
  1542.             end
  1543.         end
  1544.     end
  1545.     wait(5)
  1546.     debounce = true
  1547. end
  1548.  
  1549. game.ReplicatedStorage.Events.BuyItem32.OnServerInvoke = function(player, NamelessKingtrailName)
  1550.     if debounce == true then
  1551.         debounce = false
  1552.         --print("RemoteFunction fired")
  1553.         local ifsInInventory   
  1554.         if player.TrailInventory:FindFirstChild("NamelessKing") then
  1555.             ifsInInventory = true
  1556.         end
  1557.  
  1558.         if NamelessKingtrail then
  1559.             if NamelessKingtrail:FindFirstChild("Price") then
  1560.                 if not ifsInInventory then
  1561.                     -- Check if we can buy the trail
  1562.                     if player.leaderstats.Coins.Value >= NamelessKingtrail.Price.Value then
  1563.                         print(player.Name.." brought the ".. NamelessKingtrail.Name.." trail")
  1564.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - NamelessKingtrail.Price.Value
  1565.                         local bool32 = Instance.new("BoolValue",player.TrailInventory); bool32.Name = NamelessKingtrail.Name
  1566.                         return "Brought"
  1567.                     else
  1568.                         return "NotEnough"     
  1569.                     end
  1570.                 else
  1571.                     -- You already owned it
  1572.                     if player.EquippedTrail.Value ~= NamelessKingtrail.Name and ifsInInventory then                            
  1573.                         player.EquippedTrail.Value = NamelessKingtrail.Name
  1574.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  1575.                         wait(1)
  1576.                         debounce = true
  1577.                         return "Equip"                 
  1578.                     else                       
  1579.                         player.EquippedTrail.Value = ""
  1580.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  1581.                         wait(1)
  1582.                         debounce = true
  1583.                         return "Unequip"               
  1584.                     end        
  1585.                 end        
  1586.             end
  1587.         end
  1588.     end
  1589.     wait(5)
  1590.     debounce = true
  1591. end
  1592.  
  1593. game.ReplicatedStorage.Events.BuyItem33.OnServerInvoke = function(player, SolairetrailName)
  1594.     if debounce == true then
  1595.         debounce = false
  1596.         --print("RemoteFunction fired")
  1597.         local ifsInInventory   
  1598.         if player.TrailInventory:FindFirstChild("Solaire") then
  1599.             ifsInInventory = true
  1600.         end
  1601.  
  1602.         if Solairetrail then
  1603.             if Solairetrail:FindFirstChild("Price") then
  1604.                 if not ifsInInventory then
  1605.                     -- Check if we can buy the trail
  1606.                     if player.leaderstats.Coins.Value >= Solairetrail.Price.Value then
  1607.                         print(player.Name.." brought the ".. Solairetrail.Name.." trail")
  1608.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Solairetrail.Price.Value
  1609.                         local bool33 = Instance.new("BoolValue",player.TrailInventory); bool33.Name = Solairetrail.Name
  1610.                         return "Brought"
  1611.                     else
  1612.                         return "NotEnough"     
  1613.                     end
  1614.                 else
  1615.                     -- You already owned it
  1616.                     if player.EquippedTrail.Value ~= Solairetrail.Name and ifsInInventory then                             
  1617.                         player.EquippedTrail.Value = Solairetrail.Name
  1618.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  1619.                         wait(1)
  1620.                         debounce = true
  1621.                         return "Equip"                 
  1622.                     else                       
  1623.                         player.EquippedTrail.Value = ""
  1624.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  1625.                         wait(1)
  1626.                         debounce = true
  1627.                         return "Unequip"               
  1628.                     end        
  1629.                 end        
  1630.             end
  1631.         end
  1632.     end
  1633.     wait(5)
  1634.     debounce = true
  1635. end
  1636.  
  1637. game.ReplicatedStorage.Events.BuyItem34.OnServerInvoke = function(player, SpongebobtrailName)
  1638.     if debounce == true then
  1639.         debounce = false
  1640.         --print("RemoteFunction fired")
  1641.         local ifsInInventory   
  1642.         if player.TrailInventory:FindFirstChild("Spongebob") then
  1643.             ifsInInventory = true
  1644.         end
  1645.  
  1646.         if Spongebobtrail then
  1647.             if Spongebobtrail:FindFirstChild("Price") then
  1648.                 if not ifsInInventory then
  1649.                     -- Check if we can buy the trail
  1650.                     if player.leaderstats.Coins.Value >= Spongebobtrail.Price.Value then
  1651.                         print(player.Name.." brought the ".. Spongebobtrail.Name.." trail")
  1652.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Spongebobtrail.Price.Value
  1653.                         local bool34 = Instance.new("BoolValue",player.TrailInventory); bool34.Name = Spongebobtrail.Name
  1654.                         return "Brought"
  1655.                     else
  1656.                         return "NotEnough"     
  1657.                     end
  1658.                 else
  1659.                     -- You already owned it
  1660.                     if player.EquippedTrail.Value ~= Spongebobtrail.Name and ifsInInventory then                               
  1661.                         player.EquippedTrail.Value = Spongebobtrail.Name
  1662.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  1663.                         wait(1)
  1664.                         debounce = true
  1665.                         return "Equip"                 
  1666.                     else                       
  1667.                         player.EquippedTrail.Value = ""
  1668.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  1669.                         wait(1)
  1670.                         debounce = true
  1671.                         return "Unequip"               
  1672.                     end        
  1673.                 end        
  1674.             end
  1675.         end
  1676.     end
  1677.     wait(5)
  1678.     debounce = true
  1679. end
  1680.  
  1681. game.ReplicatedStorage.Events.BuyItem35.OnServerInvoke = function(player, MariotrailName)
  1682.     if debounce == true then
  1683.         debounce = false
  1684.         --print("RemoteFunction fired")
  1685.         local ifsInInventory   
  1686.         if player.TrailInventory:FindFirstChild("Mario") then
  1687.             ifsInInventory = true
  1688.         end
  1689.  
  1690.         if Mariotrail then
  1691.             if Mariotrail:FindFirstChild("Price") then
  1692.                 if not ifsInInventory then
  1693.                     -- Check if we can buy the trail
  1694.                     if player.leaderstats.Coins.Value >= Mariotrail.Price.Value then
  1695.                         print(player.Name.." brought the ".. Mariotrail.Name.." trail")
  1696.                         player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Mariotrail.Price.Value
  1697.                         local bool34 = Instance.new("BoolValue",player.TrailInventory); bool34.Name = Mariotrail.Name
  1698.                         return "Brought"
  1699.                     else
  1700.                         return "NotEnough"     
  1701.                     end
  1702.                 else
  1703.                     -- You already owned it
  1704.                     if player.EquippedTrail.Value ~= Mariotrail.Name and ifsInInventory then                               
  1705.                         player.EquippedTrail.Value = Mariotrail.Name
  1706.                         --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")      
  1707.                         wait(1)
  1708.                         debounce = true
  1709.                         return "Equip"                 
  1710.                     else                       
  1711.                         player.EquippedTrail.Value = ""
  1712.                         --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
  1713.                         wait(1)
  1714.                         debounce = true
  1715.                         return "Unequip"               
  1716.                     end        
  1717.                 end        
  1718.             end
  1719.         end
  1720.     end
  1721.     wait(5)
  1722.     debounce = true
  1723. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement