recently started writing scripts and I got this error the script itself is here
PlayerGui.ShopGui.Frame.ScrollingFrame_12.ScrollingFrame.Arranger:9: attempt to index nil with 'IsA'
and script
game.ReplicatedStorage.GameClient.Events.RemoteEvent.PlayerLoaded:FireServer()
print("PlayerLoaded")
local player = game.Players.LocalPlayer
local number = 1
game.ReplicatedStorage.GameClient.Events.RemoteEvent.BeginArrangement.OnClientEvent:Connect(function()
print("Got")
repeat
local image = game.ReplicatedStorage.ToolsImage:FindFirstChild(number)
if image:IsA ("ImageLabel") then
print(image.Name)
local clone = game.ReplicatedStorage.Template:Clone()
clone.ToolImageDisp.ImageLabel.Image = image.Image
clone.Name = image.Name
clone.CostDisplay.Value = image.Cost.Value
clone.ToolName.Value = image.ToolName.Value
clone.Parent = script.Parent
clone.ToolImageDisp.ImageLabel.ImageColor3 = Color3.fromRGB(0,0,0)
if clone.Name == "1" then
local sidemenu = script.Parent.Parent.Parent.SideMenu
sidemenu.ImageOftool.Image = image.Image
sidemenu.ImageOftool.ImageColor3 = Color3.fromRGB(255,255,255)
sidemenu.BuyButton.TextButton.Text = "Equip"
sidemenu.Cost.CostOfTool.Value = 0
sidemenu.Cost.CostDisplayer.Text = "Cost : 0"
sidemenu.NameOftool.TextLabel.Text = clone.ToolName.Value
end
if player.OwnedItems:FindFirstChild(clone.ToolName.Value) then
clone.ToolImageDisp.ImageLabel.ImageColor3 = Color3.fromRGB(255,255,255)
end
local equipped = player:WaitForChild("Equipped")
if equipped.Value~= nil then
if clone.ToolName.Value == equipped.Value then
local sidemenu = script.Parent.Parent.Parent.SideMenu
sidemenu.ImageOftool.Image = image.Image
sidemenu.ImageOftool.ImageColor3 = Color3.fromRGB(255,255,255)
sidemenu.BuyButton.TextButton.Text = "Equipped"
sidemenu.Cost.CostOfTool.Value = clone.CostDisplay.Value
sidemenu.Cost.CostDisplayer.Text = "Cost : "..sidemenu.Cost.CostOfTool.Value
sidemenu.NameOftool.TextLabel.Text = clone.ToolName.Value
game.ReplicatedStorage.GameClient.Events.RemoteEvent.EquipTool:FireServer(equipped.Value)
end
end
local number = tonumber(clone.Name)
if number ~= 1 then
local previousnum = number-1
local itemfound = script.Parent:FindFirstChild(previousnum)
if itemfound then
if player.OwnedItems:FindFirstChild(itemfound.ToolName.Value) then
clone.ToolImageDisp.ImageLabel.ImageColor3 = Color3.fromRGB(255,255,255)
end
end
end
end
number = number+1
until number == game.ReplicatedStorage.TotalTools.Value + 1
end)
GUYS PLS HELP ME

1 comment
You should check if the image actually exists