Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Variables
- local debounce = true
- local dataStore = game:GetService("DataStoreService"):GetDataStore("TrailShop(1)")
- local Snowtrail = game.ReplicatedStorage.Trails:FindFirstChild("Snow")
- local Redtrail = game.ReplicatedStorage.Trails:FindFirstChild("Red")
- local Limetrail = game.ReplicatedStorage.Trails:FindFirstChild("Lime")
- local Bluetrail = game.ReplicatedStorage.Trails:FindFirstChild("Blue")
- local Pinktrail = game.ReplicatedStorage.Trails:FindFirstChild("Pink")
- local Orangetrail = game.ReplicatedStorage.Trails:FindFirstChild("Orange")
- local Purpletrail = game.ReplicatedStorage.Trails:FindFirstChild("Purple")
- local Yellowtrail = game.ReplicatedStorage.Trails:FindFirstChild("Yellow")
- local Diamondtrail = game.ReplicatedStorage.Trails:FindFirstChild("Diamond")
- local Darktrail = game.ReplicatedStorage.Trails:FindFirstChild("Dark")
- local Rainbowtrail = game.ReplicatedStorage.Trails:FindFirstChild("Rainbow")
- local Helltrail = game.ReplicatedStorage.Trails:FindFirstChild("Hell")
- local Demontrail = game.ReplicatedStorage.Trails:FindFirstChild("Demon")
- local Crimsontrail = game.ReplicatedStorage.Trails:FindFirstChild("Crimson")
- local Wavestrail = game.ReplicatedStorage.Trails:FindFirstChild("Waves")
- local Reapertrail = game.ReplicatedStorage.Trails:FindFirstChild("Reaper")
- local Ghoultrail = game.ReplicatedStorage.Trails:FindFirstChild("Ghoul")
- local Dragontrail = game.ReplicatedStorage.Trails:FindFirstChild("Dragon")
- local Voidtrail = game.ReplicatedStorage.Trails:FindFirstChild("Void")
- local Foxtrail = game.ReplicatedStorage.Trails:FindFirstChild("Fox")
- local Kyuubitrail = game.ReplicatedStorage.Trails:FindFirstChild("Kyuubi")
- local NineTailstrail = game.ReplicatedStorage.Trails:FindFirstChild("NineTails")
- local Juubitrail = game.ReplicatedStorage.Trails:FindFirstChild("Juubi")
- local MadaraJuubitrail = game.ReplicatedStorage.Trails:FindFirstChild("Madara&Juubi")
- local ObitoMadaratrail = game.ReplicatedStorage.Trails:FindFirstChild("Obito&Madara")
- local Aizentrail = game.ReplicatedStorage.Trails:FindFirstChild("Aizen")
- local VastoLordtrail = game.ReplicatedStorage.Trails:FindFirstChild("VastoLord")
- local Gokutrail = game.ReplicatedStorage.Trails:FindFirstChild("Goku")
- local OnePunchtrail = game.ReplicatedStorage.Trails:FindFirstChild("OnePunch")
- local Kratostrail = game.ReplicatedStorage.Trails:FindFirstChild("Kratos")
- local DoomSlayertrail = game.ReplicatedStorage.Trails:FindFirstChild("DoomSlayer")
- local NamelessKingtrail = game.ReplicatedStorage.Trails:FindFirstChild("NamelessKing")
- local Solairetrail = game.ReplicatedStorage.Trails:FindFirstChild("Solaire")
- local Spongebobtrail = game.ReplicatedStorage.Trails:FindFirstChild("Spongebob")
- local Mariotrail = game.ReplicatedStorage.Trails:FindFirstChild("Mario")
- -- Functions
- local function EquipTrail(plr,trail)
- local char = plr.Character
- if trail ~= nil and char ~= nil then
- if char.HumanoidRootPart:FindFirstChild("Attachment") then char.HumanoidRootPart.Attachment:Destroy() end
- if char.Head:FindFirstChild("Attachment") then char.Head.Attachment:Destroy() end
- if char:FindFirstChild(plr.Name.."'s Trail") then char[plr.Name.."'s Trail"]:Destroy() end
- trail.Name = plr.Name.."'s Trail"
- local attachment1 = Instance.new("Attachment",char:FindFirstChild("HumanoidRootPart"))
- local attachment2 = Instance.new("Attachment",char:FindFirstChild("Head"))
- trail.Attachment0 = attachment1
- trail.Attachment1 = attachment2
- trail.Parent = char
- end
- end
- -- Player Joins
- game.Players.PlayerAdded:Connect(function(player)
- -- Stats for the player
- local trailInventory = Instance.new("Folder",player); trailInventory.Name = "TrailInventory"
- local equippedTrail = Instance.new("StringValue",player); equippedTrail.Name = "EquippedTrail"
- -- Player's character added to the game
- player.CharacterAdded:Connect(function(char)
- if game.ReplicatedStorage.Trails:FindFirstChild(equippedTrail.Value) then
- EquipTrail(player,game.ReplicatedStorage.Trails:FindFirstChild(equippedTrail.Value):Clone())
- end
- end)
- -- If the equipped Value changed, it will get their trail
- equippedTrail.Changed:Connect(function()
- if equippedTrail.Value ~= nil then
- if game.ReplicatedStorage.Trails:FindFirstChild(equippedTrail.Value) then
- EquipTrail(player,game.ReplicatedStorage.Trails:FindFirstChild(equippedTrail.Value):Clone())
- end
- end
- if equippedTrail.Value == "" then
- local char = player.Character
- local root = char:FindFirstChild("HumanoidRootPart")
- local head = char:FindFirstChild("Head")
- if root:FindFirstChild("Attachment") then root.Attachment:Destroy() end
- if head:FindFirstChild("Attachment") then head.Attachment:Destroy() end
- if char:FindFirstChild(player.Name.."'s Trail") then char[player.Name.."'s Trail"]:Destroy() end
- end
- end)
- -- loaded up the data
- local data
- local success, errorMsg = pcall(function()
- data = dataStore:GetAsync(player.UserId)
- end)
- if data ~= nil then
- if data.EquippedTrail then
- equippedTrail.Value = data.EquippedTrail
- end
- if data.Trails then
- for index,trail in pairs(data.Trails) do
- local bool = Instance.new("BoolValue",trailInventory); bool.Name = trail
- end
- end
- else
- -- New player
- print("A new challenger approch")
- end
- -- This event will fire the client to update the gui
- game.ReplicatedStorage.Events.SendData:FireClient(player,data)
- end)
- game.Players.PlayerRemoving:Connect(function(player)
- -- Data holder
- local data = {}
- data.EquippedTrail = player.EquippedTrail.Value
- data.Trails = {}
- for i,v in pairs(player.TrailInventory:GetChildren()) do
- table.insert(data.Trails,v.Name)
- end
- local success, errorMsg = pcall(function()
- dataStore:SetAsync(player.UserId,data)
- end)
- -- if its succeed then the data is saved else we got an error
- if success then
- print("Trails Succesfully saved")
- else
- print(errorMsg)
- end
- end)
- game:BindToClose(function()
- for index, player in pairs(game.Players:GetPlayers()) do
- local data = {}
- data.EquippedTrail = player.EquippedTrail.Value
- data.Trails = {}
- for i,v in pairs(player.TrailInventory:GetChildren()) do
- table.insert(data.Trails,v.Name)
- end
- local success, errorMsg = pcall(function()
- dataStore:SetAsync(player.UserId,data)
- end)
- -- if its succeed then the data is saved else we got an error
- if success then
- print("Succesfully saved")
- else
- print(errorMsg)
- end
- end
- end)
- -- Server Events
- game.ReplicatedStorage.Events.BuyItem1.OnServerInvoke = function(player, SnowtrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Snow") then
- ifsInInventory = true
- end
- if Snowtrail then
- if Snowtrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Snowtrail.Price.Value then
- print(player.Name.." brought the ".. Snowtrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Snowtrail.Price.Value
- local bool = Instance.new("BoolValue",player.TrailInventory); bool.Name = Snowtrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Snowtrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Snowtrail.Name
- --print(player.Name.." equipped the ".. Snowtrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Snowtrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem2.OnServerInvoke = function(player, RedtrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Red") then
- ifsInInventory = true
- end
- if Redtrail then
- if Redtrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Redtrail.Price.Value then
- print(player.Name.." brought the ".. Redtrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Redtrail.Price.Value
- local bool2 = Instance.new("BoolValue",player.TrailInventory); bool2.Name = Redtrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Redtrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Redtrail.Name
- -- print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem3.OnServerInvoke = function(player, LimetrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Lime") then
- ifsInInventory = true
- end
- if Limetrail then
- if Limetrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Limetrail.Price.Value then
- print(player.Name.." brought the ".. Limetrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Limetrail.Price.Value
- local bool3 = Instance.new("BoolValue",player.TrailInventory); bool3.Name = Limetrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Limetrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Limetrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem4.OnServerInvoke = function(player, BluetrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Blue") then
- ifsInInventory = true
- end
- if Bluetrail then
- if Bluetrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Bluetrail.Price.Value then
- print(player.Name.." brought the ".. Bluetrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Bluetrail.Price.Value
- local bool4 = Instance.new("BoolValue",player.TrailInventory); bool4.Name = Bluetrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Bluetrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Bluetrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem5.OnServerInvoke = function(player, PinktrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Pink") then
- ifsInInventory = true
- end
- if Pinktrail then
- if Pinktrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Pinktrail.Price.Value then
- print(player.Name.." brought the ".. Pinktrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Pinktrail.Price.Value
- local bool5 = Instance.new("BoolValue",player.TrailInventory); bool5.Name = Pinktrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Pinktrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Pinktrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem6.OnServerInvoke = function(player, OrangetrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Orange") then
- ifsInInventory = true
- end
- if Orangetrail then
- if Orangetrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Orangetrail.Price.Value then
- print(player.Name.." brought the ".. Orangetrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Orangetrail.Price.Value
- local bool6 = Instance.new("BoolValue",player.TrailInventory); bool6.Name = Orangetrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Orangetrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Orangetrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem7.OnServerInvoke = function(player, PurpletrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Purple") then
- ifsInInventory = true
- end
- if Purpletrail then
- if Purpletrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Purpletrail.Price.Value then
- print(player.Name.." brought the ".. Purpletrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Purpletrail.Price.Value
- local bool7 = Instance.new("BoolValue",player.TrailInventory); bool7.Name = Purpletrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Purpletrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Purpletrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem8.OnServerInvoke = function(player, YellowtrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Yellow") then
- ifsInInventory = true
- end
- if Yellowtrail then
- if Yellowtrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Yellowtrail.Price.Value then
- print(player.Name.." brought the ".. Yellowtrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Yellowtrail.Price.Value
- local bool8 = Instance.new("BoolValue",player.TrailInventory); bool8.Name = Yellowtrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Yellowtrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Yellowtrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem9.OnServerInvoke = function(player, DiamondtrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Diamond") then
- ifsInInventory = true
- end
- if Diamondtrail then
- if Diamondtrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Diamondtrail.Price.Value then
- print(player.Name.." brought the ".. Diamondtrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Diamondtrail.Price.Value
- local bool9 = Instance.new("BoolValue",player.TrailInventory); bool9.Name = Diamondtrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Diamondtrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Diamondtrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem10.OnServerInvoke = function(player, DarktrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Dark") then
- ifsInInventory = true
- end
- if Darktrail then
- if Darktrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Darktrail.Price.Value then
- print(player.Name.." brought the ".. Darktrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Darktrail.Price.Value
- local bool10 = Instance.new("BoolValue",player.TrailInventory); bool10.Name = Darktrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Darktrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Darktrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem11.OnServerInvoke = function(player, RainbowtrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Rainbow") then
- ifsInInventory = true
- end
- if Rainbowtrail then
- if Rainbowtrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Rainbowtrail.Price.Value then
- print(player.Name.." brought the ".. Rainbowtrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Rainbowtrail.Price.Value
- local bool11 = Instance.new("BoolValue",player.TrailInventory); bool11.Name = Rainbowtrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Rainbowtrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Rainbowtrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem12.OnServerInvoke = function(player, HelltrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Hell") then
- ifsInInventory = true
- end
- if Helltrail then
- if Helltrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Helltrail.Price.Value then
- print(player.Name.." brought the ".. Helltrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Helltrail.Price.Value
- local bool12 = Instance.new("BoolValue",player.TrailInventory); bool12.Name = Helltrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Helltrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Helltrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem13.OnServerInvoke = function(player, DemontrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Demon") then
- ifsInInventory = true
- end
- if Demontrail then
- if Demontrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Demontrail.Price.Value then
- print(player.Name.." brought the ".. Demontrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Demontrail.Price.Value
- local bool13 = Instance.new("BoolValue",player.TrailInventory); bool13.Name = Demontrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Demontrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Demontrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem14.OnServerInvoke = function(player, CrimsontrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Crimson") then
- ifsInInventory = true
- end
- if Crimsontrail then
- if Crimsontrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Crimsontrail.Price.Value then
- print(player.Name.." brought the ".. Crimsontrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Crimsontrail.Price.Value
- local bool14 = Instance.new("BoolValue",player.TrailInventory); bool14.Name = Crimsontrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Crimsontrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Crimsontrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem15.OnServerInvoke = function(player, WavestrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Waves") then
- ifsInInventory = true
- end
- if Wavestrail then
- if Wavestrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Wavestrail.Price.Value then
- print(player.Name.." brought the ".. Wavestrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Wavestrail.Price.Value
- local bool15 = Instance.new("BoolValue",player.TrailInventory); bool15.Name = Wavestrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Wavestrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Wavestrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem16.OnServerInvoke = function(player, ReapertrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Reaper") then
- ifsInInventory = true
- end
- if Reapertrail then
- if Reapertrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Reapertrail.Price.Value then
- print(player.Name.." brought the ".. Reapertrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Reapertrail.Price.Value
- local bool16 = Instance.new("BoolValue",player.TrailInventory); bool16.Name = Reapertrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Reapertrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Reapertrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem17.OnServerInvoke = function(player, GhoultrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Ghoul") then
- ifsInInventory = true
- end
- if Ghoultrail then
- if Ghoultrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Ghoultrail.Price.Value then
- print(player.Name.." brought the ".. Ghoultrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Ghoultrail.Price.Value
- local bool17 = Instance.new("BoolValue",player.TrailInventory); bool17.Name = Ghoultrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Ghoultrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Ghoultrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem18.OnServerInvoke = function(player, DragontrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Dragon") then
- ifsInInventory = true
- end
- if Dragontrail then
- if Dragontrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Dragontrail.Price.Value then
- print(player.Name.." brought the ".. Dragontrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Dragontrail.Price.Value
- local bool18 = Instance.new("BoolValue",player.TrailInventory); bool18.Name = Dragontrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Dragontrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Dragontrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem19.OnServerInvoke = function(player, VoidtrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Void") then
- ifsInInventory = true
- end
- if Voidtrail then
- if Voidtrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Voidtrail.Price.Value then
- print(player.Name.." brought the ".. Voidtrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Voidtrail.Price.Value
- local bool19 = Instance.new("BoolValue",player.TrailInventory); bool19.Name = Voidtrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Voidtrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Voidtrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem20.OnServerInvoke = function(player, FoxtrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Fox") then
- ifsInInventory = true
- end
- if Foxtrail then
- if Foxtrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Foxtrail.Price.Value then
- print(player.Name.." brought the ".. Foxtrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Foxtrail.Price.Value
- local bool20 = Instance.new("BoolValue",player.TrailInventory); bool20.Name = Foxtrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Foxtrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Foxtrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem21.OnServerInvoke = function(player, KyuubitrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Kyuubi") then
- ifsInInventory = true
- end
- if Kyuubitrail then
- if Kyuubitrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Kyuubitrail.Price.Value then
- print(player.Name.." brought the ".. Kyuubitrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Kyuubitrail.Price.Value
- local bool21 = Instance.new("BoolValue",player.TrailInventory); bool21.Name = Kyuubitrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Kyuubitrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Kyuubitrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem22.OnServerInvoke = function(player, NineTailstrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("NineTails") then
- ifsInInventory = true
- end
- if NineTailstrail then
- if NineTailstrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= NineTailstrail.Price.Value then
- print(player.Name.." brought the ".. NineTailstrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - NineTailstrail.Price.Value
- local bool22 = Instance.new("BoolValue",player.TrailInventory); bool22.Name = NineTailstrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= NineTailstrail.Name and ifsInInventory then
- player.EquippedTrail.Value = NineTailstrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem23.OnServerInvoke = function(player, JuubitrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Juubi") then
- ifsInInventory = true
- end
- if Juubitrail then
- if Juubitrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Juubitrail.Price.Value then
- print(player.Name.." brought the ".. Juubitrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Juubitrail.Price.Value
- local bool23 = Instance.new("BoolValue",player.TrailInventory); bool23.Name = Juubitrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Juubitrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Juubitrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem24.OnServerInvoke = function(player, MadaraJuubitrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Madara&Juubi") then
- ifsInInventory = true
- end
- if MadaraJuubitrail then
- if MadaraJuubitrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= MadaraJuubitrail.Price.Value then
- print(player.Name.." brought the ".. MadaraJuubitrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - MadaraJuubitrail.Price.Value
- local bool24 = Instance.new("BoolValue",player.TrailInventory); bool24.Name = MadaraJuubitrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= MadaraJuubitrail.Name and ifsInInventory then
- player.EquippedTrail.Value = MadaraJuubitrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem25.OnServerInvoke = function(player, ObitoMadaratrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Obito&Madara") then
- ifsInInventory = true
- end
- if ObitoMadaratrail then
- if ObitoMadaratrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= ObitoMadaratrail.Price.Value then
- print(player.Name.." brought the ".. ObitoMadaratrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - ObitoMadaratrail.Price.Value
- local bool25 = Instance.new("BoolValue",player.TrailInventory); bool25.Name = ObitoMadaratrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= ObitoMadaratrail.Name and ifsInInventory then
- player.EquippedTrail.Value = ObitoMadaratrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem26.OnServerInvoke = function(player, AizentrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Aizen") then
- ifsInInventory = true
- end
- if Aizentrail then
- if Aizentrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Aizentrail.Price.Value then
- print(player.Name.." brought the ".. Aizentrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Aizentrail.Price.Value
- local bool26 = Instance.new("BoolValue",player.TrailInventory); bool26.Name = Aizentrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Aizentrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Aizentrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem27.OnServerInvoke = function(player, VastoLordtrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("VastoLord") then
- ifsInInventory = true
- end
- if VastoLordtrail then
- if VastoLordtrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= VastoLordtrail.Price.Value then
- print(player.Name.." brought the ".. VastoLordtrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - VastoLordtrail.Price.Value
- local bool27 = Instance.new("BoolValue",player.TrailInventory); bool27.Name = VastoLordtrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= VastoLordtrail.Name and ifsInInventory then
- player.EquippedTrail.Value = VastoLordtrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem28.OnServerInvoke = function(player, GokutrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Goku") then
- ifsInInventory = true
- end
- if Gokutrail then
- if Gokutrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Gokutrail.Price.Value then
- print(player.Name.." brought the ".. Gokutrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Gokutrail.Price.Value
- local bool28 = Instance.new("BoolValue",player.TrailInventory); bool28.Name = Gokutrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Gokutrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Gokutrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem29.OnServerInvoke = function(player, OnePunchtrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("OnePunch") then
- ifsInInventory = true
- end
- if OnePunchtrail then
- if OnePunchtrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= OnePunchtrail.Price.Value then
- print(player.Name.." brought the ".. OnePunchtrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - OnePunchtrail.Price.Value
- local bool29 = Instance.new("BoolValue",player.TrailInventory); bool29.Name = OnePunchtrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= OnePunchtrail.Name and ifsInInventory then
- player.EquippedTrail.Value = OnePunchtrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem30.OnServerInvoke = function(player, KratostrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Kratos") then
- ifsInInventory = true
- end
- if Kratostrail then
- if Kratostrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Kratostrail.Price.Value then
- print(player.Name.." brought the ".. Kratostrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Kratostrail.Price.Value
- local bool30 = Instance.new("BoolValue",player.TrailInventory); bool30.Name = Kratostrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Kratostrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Kratostrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem31.OnServerInvoke = function(player, DoomSlayertrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("DoomSlayer") then
- ifsInInventory = true
- end
- if DoomSlayertrail then
- if DoomSlayertrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= DoomSlayertrail.Price.Value then
- print(player.Name.." brought the ".. DoomSlayertrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - DoomSlayertrail.Price.Value
- local bool31 = Instance.new("BoolValue",player.TrailInventory); bool31.Name = DoomSlayertrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= DoomSlayertrail.Name and ifsInInventory then
- player.EquippedTrail.Value = DoomSlayertrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem32.OnServerInvoke = function(player, NamelessKingtrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("NamelessKing") then
- ifsInInventory = true
- end
- if NamelessKingtrail then
- if NamelessKingtrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= NamelessKingtrail.Price.Value then
- print(player.Name.." brought the ".. NamelessKingtrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - NamelessKingtrail.Price.Value
- local bool32 = Instance.new("BoolValue",player.TrailInventory); bool32.Name = NamelessKingtrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= NamelessKingtrail.Name and ifsInInventory then
- player.EquippedTrail.Value = NamelessKingtrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem33.OnServerInvoke = function(player, SolairetrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Solaire") then
- ifsInInventory = true
- end
- if Solairetrail then
- if Solairetrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Solairetrail.Price.Value then
- print(player.Name.." brought the ".. Solairetrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Solairetrail.Price.Value
- local bool33 = Instance.new("BoolValue",player.TrailInventory); bool33.Name = Solairetrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Solairetrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Solairetrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem34.OnServerInvoke = function(player, SpongebobtrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Spongebob") then
- ifsInInventory = true
- end
- if Spongebobtrail then
- if Spongebobtrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Spongebobtrail.Price.Value then
- print(player.Name.." brought the ".. Spongebobtrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Spongebobtrail.Price.Value
- local bool34 = Instance.new("BoolValue",player.TrailInventory); bool34.Name = Spongebobtrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Spongebobtrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Spongebobtrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
- game.ReplicatedStorage.Events.BuyItem35.OnServerInvoke = function(player, MariotrailName)
- if debounce == true then
- debounce = false
- --print("RemoteFunction fired")
- local ifsInInventory
- if player.TrailInventory:FindFirstChild("Mario") then
- ifsInInventory = true
- end
- if Mariotrail then
- if Mariotrail:FindFirstChild("Price") then
- if not ifsInInventory then
- -- Check if we can buy the trail
- if player.leaderstats.Coins.Value >= Mariotrail.Price.Value then
- print(player.Name.." brought the ".. Mariotrail.Name.." trail")
- player.leaderstats.Coins.Value = player.leaderstats.Coins.Value - Mariotrail.Price.Value
- local bool34 = Instance.new("BoolValue",player.TrailInventory); bool34.Name = Mariotrail.Name
- return "Brought"
- else
- return "NotEnough"
- end
- else
- -- You already owned it
- if player.EquippedTrail.Value ~= Mariotrail.Name and ifsInInventory then
- player.EquippedTrail.Value = Mariotrail.Name
- --print(player.Name.." equipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Equip"
- else
- player.EquippedTrail.Value = ""
- --print(player.Name.." unequipped the ".. Bluetrail.Name.." trail")
- wait(1)
- debounce = true
- return "Unequip"
- end
- end
- end
- end
- end
- wait(5)
- debounce = true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement