Trying to make a shop that equips bought items

Im trying to make a script for my simulator for when you buy the next item on the shop you lose the other item and cant buy the lower tier item again i also want to make it so you cant skip a item in the shop so you have to rank up in swords for example: Ninja Legends

1
2

Any help is appreciate thanks!

1 Like

I would love to help, but I am not sure how. Your shop looks amazing so far!

Thats not my shop its the ninja legends shop

What I do is check what text the button is. If it is equip, fire a remote event and then on the server, clone it to the player. (Make sure to implement security check)

1 Like

after you verify a tool has been bought just destroy the current tool from the player’s backpack, or if there’s multiple types of tools then use string manipulation to some extent; for example considering a player can only carry one type of sword, and one type of explosive, you could name all swords with the prefix ‘sword’ so that when a sword has been bought you would do something like

  local function OnSwordPurchased(toolName)
  for _,t in ipairs(player.Backpack:GetChildren()) do
          if t.Name:match("sword") then
             t:Destroy()
          end
  end
 
  Container[toolName]:Clone().Parent = player.Backpack
  
  end

so any tool that has ‘sword’ in its name will be destroyed, but the explosive would remain

1 Like

Hello thanks for replying to my post im still very beginner in scripting and i dont know how do this any chance you can help me please!

Currently, I can’t give the full scripts for it. However, there are many tutorials in YT, I’ll send one for you.


1 Like

Thank you!

30charsssssssssssss