No Default in inventory?

local ,equipped
local success,error = pcall(function()
	equipped = equipData:GetAsync(player.UserId) 
end)
if swordTable == nil then
	swordTable = {}

	player.swords:WaitForChild("Default").Value = 1
	task.wait()
	equippedSword.Value = equipped or "Default"
end
for i,info in pairs(swordTable) do
	local sword = swords:FindFirstChild(info[1])
		if sword.Name == "Default" then

equippedSword.Value is nil here, that’s why.

1 Like

how do i fix that???

ive tried but i cant

I see that it is being set here

But what if the operation fails? Add an else condition

else
	equippedSword.Value = "Default"
1 Like

Thanks, i fixed it.
iuyutjktyuiyuiyui

Try printing something in the first line of the second fucntion to see if it triggers.

script.Parent.MouseButton1Click:Connect(function()
print(“22222222222”)

Nevermind sorry, i fixed it, it was to do with layering, the other button was above

Then mark this post as solved.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.