When i buy a certain item with this script from a simulator-like shop, it gives me the error Attempt to index a nil value.
game.ReplicatedStorage.ShopBuy.OnServerEvent:Connect(function(player,page) local tool = game.ReplicatedStorage:WaitForChild("Tools") local shop = game.Workspace.Shop local clone = tool:FindFirstChild(shop:FindFirstChild("Part"..page).ItemName.Value):Clone() -- Breaks here local clone2 = tool:FindFirstChild(shop:FindFirstChild("Part"..page).ItemName.Value):Clone() clone.Parent = player.Backpack clone2.Parent = player.StarterGear -- So that the player won't lose the tool even if they died. end)