local swords = game.ServerStorage.Swords
local swordschildren = swords:GetChildren()
local secondaries = {swordschildren}
function equip(player)
local stats = player.stats
local backpackitems = player.Backpack:GetChildren()
local swords = game.ServerStorage.Swords
for i,v in pairs(backpackitems) do
if v == secondaries then
v:Delete()
local itemclone = swords[script.Parent.Parent.ItemName.Text]:Clone()
itemclone = player.Backpack
end
end
end
script.Parent.MouseButton1Down:connect(equip)
ERROR: 21:38:40.568 - Players.Player1.PlayerGui.ScreenGui.Shop.Pages.Inventory.ItemDetails.Equip.Script:6: attempt to index local 'player' (a number value) 21:38:40.569 - Stack Begin 21:38:40.569 - Script 'Players.Player1.PlayerGui.ScreenGui.Shop.Pages.Inventory.ItemDetails.Equip.Script', Line 6
When I printed the number which it thought player was, it simply printed the number '1078'. I'm very confused and tired. Your help is much appreciated.

1 comment
Is this a LocalScript or a ServerScript? https://scriptinghelpers.org/blog/common-mistakes#GuiEvent