Hi, I’m experimenting with a lot of code right now trying to figure out how to make things exploitable in my practice RPG I’m making right now. I have a module script that has the name, damage and price of my weapons in a table that I want tools, shops and npc drops to interact with. Anyways I’m trying to have the shop script I have create the tool when the player buys it inside of having the tools pre-made so the items can look different each time.
The problem I’m having through is that when I try to have a Part added into the tool, nothing appears on equip. Also the tool disappears out of the players backpack after 5 seconds of having it equiped. Heres my code :
game.Workspace.ShopBrick.ShopScript.Event.Event:Connect(function(character, item)
local player = game.Players:GetPlayerFromCharacter(character)
local tool = Instance.new("Tool", player.Backpack)
local part = Instance.new("Part", tool)
tool.Name = item
local clone = tool:Clone()
clone.Parent = player.StarterGear
print("I work")
end)
What exactly is the problem here?