Okay, so I figured out how to used tables to delete tools from char , and backpack, but what are the ways I can keep a certain variable in a table?
here's my code so far
script.Parent.Touched:Connect(function(hit)
local char = hit.Parent
local hum = char:FindFirstChild("Humanoid")
if hum then
local players = game:GetService("Players")
local player = players:GetPlayerFromCharacter(char)
local pack = player.Backpack
local findSword = pack:GetChildren()
for i,v in pairs(findSword)do
if v:IsA("Tool") then do
if v.Name == ("LinkedSword") then end -- part im struggeling with
if v then
v:Destroy()
end
end
end
end
local Char = player.Character or player.CharacterAdded:Wait()
local equippedSword = Char:GetChildren()
for i,v2 in pairs(equippedSword) do
if v2:IsA("Tool") then do
if v2 then
v2:Destroy()
end
end
end
end
end
end)
If there are other forms that can explain this to me further, I'd love the read them

2 comments
You could do an if statement then nothing else something end
Or if not statement then something end