So I made a post yesterday where my crafting system didn’t work. The crafting itself would work, but for some reason, all the tools that were given broke. I tried it with my own and then some Roblox tools. I tried a different system today, with the same result. My guess is that it’s the code:
local GivenResult = ItemResult:Clone()
GivenResult.Parent = BackPack
This is strange because I have a server script inside of a part that serves as my looting system giver and it has the same type of code:
local Clone = Tool:Clone()
Clone.Parent = Player.Character
The tools for the above code do indeed work. I’m not sure how to solve this problem, so I’m just posting this here, hoping someone might be able to help me.
Crafting script code just in case you need it:
First script tested:
local ItemStorage = game.ReplicatedStorage.Items -- general setup
local Player = game.Players.LocalPlayer
local BackPack = Player.Backpack
local ItemResult = ItemStorage.Clothing:WaitForChild("MilitaryHelmetWCover") -- items setup
local ItemOne = BackPack:FindFirstChild("WoodlandHelmetCover")
local ItemTwo = BackPack:FindFirstChild("MilitaryHelmet")
local function craftPressed()
print("Crafting")
if ItemOne then
if ItemTwo then
ItemTwo:Destroy()
ItemOne:Destroy()
local GivenResult = ItemResult:Clone()
GivenResult.Parent = BackPack
end
end
end
script.Parent.Parent.MilHelmWoodCover.MouseButton1Click:Connect(craftPressed)
Second script tested:
local ItemOne = "MilitaryHelmet"
local ItemTwo = "WoodlandHelmetCover"
local Player = script.Parent.Parent.Parent.Parent.Parent.Parent
local BackPack = Player.Backpack
local Destroyed = false
script.Parent.MouseButton1Click:Connect(function()
if BackPack:FindFirstChild(ItemTwo) then
BackPack.WoodlandHelmetCover:Destroy() -- replace this with second crafting item
Destroyed = true
if BackPack:FindFirstChild(ItemOne) then
BackPack.MilitaryHelmet:Destroy() -- replace this with first crafting item
Destroyed = false
local item = game.ReplicatedStorage.Items.Weapons.Screwdriver:Clone()
item.Parent = BackPack
else
if Destroyed == true then
local GiveBack = game.ReplicatedStorage.Items.Misc.WoodlandHelmetCover:Clone()
GiveBack.Parent = BackPack
end
end
end
end)