So im trying to make it where if a player already has a tool in starter gear the npc will say that you already have a weapon, but on line 9 the error says argument 1 missing or nil what am I supposed to do?
cd.MouseClick:Connect(function(plr)
if plr.weapon.Value == "Wood Sword"then
plr.PlayerGui.itemStatus.Text.name.Text = "Sword gal"
plr.PlayerGui.itemStatus.Text.Text = "You already have this!"
plr.PlayerGui.itemStatus.Text.Visible = true
wait(1.7)
plr.PlayerGui.itemStatus.Text.Visible = false
else
if plr.StarterGear:FindFirstChildOfClass():IsA("Tool") then
plr.PlayerGui.itemStatus.Text.name.Text = "Sword gal"
plr.PlayerGui.itemStatus.Text.Text = "You already have a weapon, if you want to reset it click on your current weapon GUI."
plr.PlayerGui.itemStatus.Text.Visible = true
wait(6)
plr.PlayerGui.itemStatus.Text.Visible = false

1 comment
There's nothing wrong with having an NPC of that name? You can really reference it using square brackets instead of indexing it using a period.